lib/cocoapods-rome/post_install.rb in cocoapods-rome-0.4.1 vs lib/cocoapods-rome/post_install.rb in cocoapods-rome-0.4.2
- old
+ new
@@ -4,14 +4,15 @@
SIMULATORS = { 'iphonesimulator' => 'iPhone 5s',
'appletvsimulator' => 'Apple TV 1080p',
'watchsimulator' => 'Apple Watch - 38mm' }
def build_for_iosish_platform(sandbox, build_dir, target, device, simulator)
+ deployment_target = target.platform_deployment_target
target_label = target.cocoapods_target_label
- xcodebuild(sandbox, target_label, device)
- xcodebuild(sandbox, target_label, simulator)
+ xcodebuild(sandbox, target_label, device, deployment_target)
+ xcodebuild(sandbox, target_label, simulator, deployment_target)
spec_names = target.specs.map { |spec| spec.root.module_name }.uniq
spec_names.each do |root_name|
executable_path = "#{build_dir}/#{root_name}"
device_lib = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_label}/#{root_name}.framework/#{root_name}"
@@ -28,13 +29,13 @@
FileUtils.rm simulator_lib if File.file?(simulator_lib)
FileUtils.rm device_lib if File.file?(device_lib)
end
end
-def xcodebuild(sandbox, target, sdk='macosx')
+def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil)
args = %W(-project #{sandbox.project_path.basename} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk})
simulator = SIMULATORS[sdk]
- args += Fourflusher::SimControl.new.destination(simulator) unless simulator.nil?
+ args += Fourflusher::SimControl.new.destination(simulator, deployment_target) unless simulator.nil?
Pod::Executable.execute_command 'xcodebuild', args, true
end
Pod::HooksManager.register('cocoapods-rome', :post_install) do |installer_context|
sandbox_root = Pathname(installer_context.sandbox_root)