lib/cocoapods-rome/post_install.rb in cocoapods-rome-0.5.0 vs lib/cocoapods-rome/post_install.rb in cocoapods-rome-0.6.0

- old
+ new

@@ -1,11 +1,11 @@ require 'fourflusher' CONFIGURATION = "Release" -SIMULATORS = { 'iphonesimulator' => 'iPhone 5s', - 'appletvsimulator' => 'Apple TV 1080p', - 'watchsimulator' => 'Apple Watch - 38mm' } +PLATFORMS = { 'iphonesimulator' => 'iOS', + 'appletvsimulator' => 'tvOS', + 'watchsimulator' => 'watchOS' } def build_for_iosish_platform(sandbox, build_dir, target, device, simulator) deployment_target = target.platform_deployment_target target_label = target.cocoapods_target_label @@ -13,13 +13,13 @@ 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}" + device_lib = "#{build_dir}/#{CONFIGURATION}-#{device}/#{root_name}/#{root_name}.framework/#{root_name}" device_framework_lib = File.dirname(device_lib) - simulator_lib = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_label}/#{root_name}.framework/#{root_name}" + simulator_lib = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{root_name}/#{root_name}.framework/#{root_name}" next unless File.file?(device_lib) && File.file?(simulator_lib) lipo_log = `lipo -create -output #{executable_path} #{device_lib} #{simulator_lib}` puts lipo_log unless File.exist?(executable_path) @@ -31,12 +31,12 @@ end end 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, deployment_target) unless simulator.nil? + platform = PLATFORMS[sdk] + args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.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) @@ -60,10 +60,10 @@ end end raise Pod::Informative, 'The build directory was not found in the expected location.' unless build_dir.directory? - frameworks = Pathname.glob("#{build_dir}/**/*.framework").reject { |f| f.to_s =~ /Pods*\.framework/ } + frameworks = Pathname.glob("#{build_dir}/**/*.framework").reject { |f| f.to_s =~ /Pods.*\.framework/ } Pod::UI.puts "Built #{frameworks.count} #{'frameworks'.pluralize(frameworks.count)}" destination.rmtree if destination.directory?