lib/cocoapods-rome/post_install.rb in cocoapods-rome-0.7.0 vs lib/cocoapods-rome/post_install.rb in cocoapods-rome-0.8.0

- old
+ new

@@ -30,11 +30,11 @@ FileUtils.rm device_lib if File.file?(device_lib) end end def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil) - args = %W(-project #{sandbox.project_path.basename} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk}) + args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk}) platform = PLATFORMS[sdk] args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil? Pod::Executable.execute_command 'xcodebuild', args, true end @@ -46,25 +46,25 @@ destination = sandbox_root.parent + 'Rome' Pod::UI.puts 'Building frameworks' build_dir.rmtree if build_dir.directory? - Dir.chdir(sandbox.project_path.dirname) do - targets = installer_context.umbrella_targets.select { |t| t.specs.any? } - targets.each do |target| - case target.platform_name - when :ios then build_for_iosish_platform(sandbox, build_dir, target, 'iphoneos', 'iphonesimulator') - when :osx then xcodebuild(sandbox, target.cocoapods_target_label) - when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator') - when :watchos then build_for_iosish_platform(sandbox, build_dir, target, 'watchos', 'watchsimulator') - else raise "Unknown platform '#{target.platform_name}'" end - end + targets = installer_context.umbrella_targets.select { |t| t.specs.any? } + targets.each do |target| + case target.platform_name + when :ios then build_for_iosish_platform(sandbox, build_dir, target, 'iphoneos', 'iphonesimulator') + when :osx then xcodebuild(sandbox, target.cocoapods_target_label) + when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator') + when :watchos then build_for_iosish_platform(sandbox, build_dir, target, 'watchos', 'watchsimulator') + else raise "Unknown platform '#{target.platform_name}'" 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/ } - + # Make sure the device target overwrites anything in the simulator build, otherwise iTunesConnect + # can get upset about Info.plist containing references to the simulator SDK + frameworks = Pathname.glob("build/*/*/*.framework").reject { |f| f.to_s =~ /Pods.*\.framework/ } + frameworks += Pathname.glob("build/*.framework").reject { |f| f.to_s =~ /Pods.*\.framework/ } Pod::UI.puts "Built #{frameworks.count} #{'frameworks'.pluralize(frameworks.count)}" destination.rmtree if destination.directory? installer_context.umbrella_targets.each do |umbrella|