zoukankan      html  css  js  c++  java
  • fastlane 编译 framework

    下面为使用fastlane编译framework的片段:
    
    def ios_build_framework( project_path, target ,code_path)
      #build for iphonesimulator
      xcodebuild(
          project: project_path,
          target: target,
          configuration: "Release",
          silent: false,
          clean: true,
          build: true,
          xcargs: "-UseModernBuildSystem=0 -sdk 'iphonesimulator'"
      )
      #build for iphone
      xcodebuild(
          project: project_path,
          target: target,
          configuration: "Release",
          silent: false,
          clean: true,
          build: true,
          xcargs: "-UseModernBuildSystem=0",
      )
      # Two libraries are combined into one, support x86_64, armv7 ,arm64
      command = "lipo -create #{code_path}/build/Release-iphoneos/#{target}.framework/#{target} #{code_path}/build/Release-iphonesimulator/#{target}.framework/#{target} -output #{code_path}/build/Release-iphoneos/#{target}.framework/#{target} "
      result = `#{command}`
    end
    
    shell命令生成:
    func_build_framework(){
    
      FMK_NAME=$1
      cd "./$1"
      BUILD_CONFIGURATION="Release"
      # Install dir will be the final output to the framework.
      # The following line create it in the root folder of the current project.
      INSTALL_DIR="./Products/${FMK_NAME}.framework"
      # Working dir will be deleted after the framework creation.
      DEVICE_DIR="./build/${BUILD_CONFIGURATION}-iphoneos/${FMK_NAME}.framework"
      SIMULATOR_DIR="./build/${BUILD_CONFIGURATION}-iphonesimulator/${FMK_NAME}.framework"
    
      xcodebuild clean -target "${FMK_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${BUILD_CONFIGURATION} -sdk iphoneos -UseModernBuildSystem=NO
      xcodebuild build -target "${FMK_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${BUILD_CONFIGURATION} -sdk iphoneos -UseModernBuildSystem=NO
      xcodebuild clean -target "${FMK_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${BUILD_CONFIGURATION} -sdk iphonesimulator -UseModernBuildSystem=NO
      xcodebuild build -target "${FMK_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${BUILD_CONFIGURATION} -sdk iphonesimulator -UseModernBuildSystem=NO
    
      # Cleaning the oldest.
      if [ -d ${INSTALL_DIR} ]
      then
      rm -rf ${INSTALL_DIR}
    
      fi
      mkdir -p ${INSTALL_DIR}
      cp -R "${DEVICE_DIR}/" "${INSTALL_DIR}/"
      # Uses the Lipo Tool to merge both binary files (x86_64 + armv64/armv7) into one Universal final product.
      lipo -create ${DEVICE_DIR}/${FMK_NAME} ${SIMULATOR_DIR}/${FMK_NAME} -output ${INSTALL_DIR}/${FMK_NAME}
    }
    
    func_build_framework "native_plugin"
    
  • 相关阅读:
    1136 A Delayed Palindrome (algorithm reverse(ans.begin,ans.end))
    1141 PAT Ranking of Institutions PAT甲级
    最近点对 (迭代器访问数据)
    1146 Topological Order PAT 甲级
    1151 1151 LCA in a Binary Tree PAT 甲级
    jQuery的基本使用
    案例:移动端返回顶部效果
    移动端轮播图(原生JS写法)
    移动端特效
    本地存储
  • 原文地址:https://www.cnblogs.com/qiyer/p/12895053.html
Copyright © 2011-2022 走看看