lib/cocoapods-binary/rome/build_framework.rb
#  Build specific target to framework file
#  @param [PodTarget] target
#         a specific pod target
#
Build specific target to framework file
Build specific target to framework file
def build_for_iosish_platform(sandbox,
                              build_dir,
                              output_path,
                              target,
                              device,
                              simulator,
                              bitcode_enabled,
                              custom_build_options = [], 
                              custom_build_options_simulator = [] 
                              )
  deployment_target = target.platform.deployment_target.to_s
  target_label = target.label 
  Pod::UI.puts "Prebuilding #{target_label}..."
  other_options = []
  other_options += ['BITCODE_GENERATION_MODE=bitcode'] if bitcode_enabled
  if simulator == 'iphonesimulator'
    joined_options = custom_build_options_simulator.join(' ')
    custom_build_options_simulator << 'ONLY_ACTIVE_ARCH=NO' unless joined_options.include?('ONLY_ACTIVE_ARCH')
    custom_build_options_simulator << 'ARCHS=x86_64' unless joined_options.include?('ARCHS')
  end
  is_succeed, _ = xcodebuild(sandbox, target_label, device, deployment_target, other_options + custom_build_options)
  exit 1 unless is_succeed
  is_succeed, _ = xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + custom_build_options_simulator)
  exit 1 unless is_succeed
  target_name = target.name 
  module_name = target.product_module_name
  device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework"
  simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework"
  xcframework_path = "#{build_dir}/#{target_name}.xcframework"
  device_binary = device_framework_path + "/#{module_name}"
  simulator_binary = simulator_framework_path + "/#{module_name}"
  return unless File.file?(device_binary) && File.file?(simulator_binary)
  xcodebuild_log =`xcodebuild -create-xcframework \
                        -framework #{device_framework_path} \
                        -framework #{simulator_framework_path} \
                        -output #{xcframework_path}`
  puts xcodebuild_log unless File.exist?(xcframework_path)
  output_path.mkpath unless output_path.exist?
  FileUtils.mv xcframework_path, output_path, :force => true
end
def build_for_iosish_platform ( sandbox , build_dir , output_path , target , device , simulator , bitcode_enabled , custom_build_options = [ ] , custom_build_options_simulator = [ ] ) deployment_target = target . platform . deployment_target . to_s target_label = target . label Pod :: UI . puts "Prebuilding #{target_label}..." other_options = [ ] other_options += [ 'BITCODE_GENERATION_MODE=bitcode' ] if bitcode_enabled if simulator == 'iphonesimulator' joined_options = custom_build_options_simulator . join ( ' ' ) custom_build_options_simulator << 'ONLY_ACTIVE_ARCH=NO' unless joined_options . include? ( 'ONLY_ACTIVE_ARCH' ) custom_build_options_simulator << 'ARCHS=x86_64' unless joined_options . include? ( 'ARCHS' ) end is_succeed , _ = xcodebuild ( sandbox , target_label , device , deployment_target , other_options + custom_build_options ) exit 1 unless is_succeed is_succeed , _ = xcodebuild ( sandbox , target_label , simulator , deployment_target , other_options + custom_build_options_simulator ) exit 1 unless is_succeed target_name = target . name module_name = target . product_module_name device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework" simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework" xcframework_path = "#{build_dir}/#{target_name}.xcframework" device_binary = device_framework_path + "/#{module_name}" simulator_binary = simulator_framework_path + "/#{module_name}" return unless File . file? ( device_binary ) && File . file? ( simulator_binary ) xcodebuild_log = ` xcodebuild -create-xcframework  \
                         -framework  #{ device_framework_path } \
                         -framework  #{ simulator_framework_path } \
                         -output  #{ xcframework_path } ` puts xcodebuild_log unless File . exist? ( xcframework_path ) output_path . mkpath unless output_path . exist? FileUtils . mv xcframework_path , output_path , :force => true end
Build specific target to framework file
Build specific target to framework file
# Array<String> # Array<String> # name with platform if it's used in multiple platforms # bitcode enabled # make less arch to iphone simulator for faster build if there is no options in `custom_build_options_simulator` # paths # equals target.label, like "AFNeworking-iOS" when AFNetworking is used in multiple platforms. # output
sandbox
<not_specific>
build_dir
<not_specific>
output_path
<not_specific>
target
<not_specific>
device
<not_specific>
simulator
<not_specific>
bitcode_enabled
<not_specific>
custom_build_options
<not_specific>
custom_build_options_simulator
<not_specific>
<not_specific>
target a specific pod target
target a specific pod target