diff --git a/lib/cocoapods-packager/pod_utils.rb b/lib/cocoapods-packager/pod_utils.rb index ae9b607..b9b12f7 100644 --- a/lib/cocoapods-packager/pod_utils.rb +++ b/lib/cocoapods-packager/pod_utils.rb @@ -135,6 +135,7 @@ def install_dynamic_pod(dynamic_sandbox, static_sandbox, static_installer) # 9. Write the actual Xcodeproject to the dynamic sandbox. write_pod_project(project, dynamic_sandbox) + project end def build_dynamic_target(dynamic_sandbox, static_installer) @@ -223,6 +224,7 @@ def write_pod_project(dynamic_project, dynamic_sandbox) config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) #{Dir.pwd}/Pods/Static/Headers/**" config.build_settings['USER_HEADER_SEARCH_PATHS'] = "$(inherited) #{Dir.pwd}/Pods/Static/Headers/**" config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -ObjC' + config.build_settings['BITCODE_GENERATION_MODE'] = "bitcode" end dynamic_project.save end diff --git a/spec/pod/utils_spec.rb b/spec/pod/utils_spec.rb index 41e7151..376b15c 100644 --- a/spec/pod/utils_spec.rb +++ b/spec/pod/utils_spec.rb @@ -54,5 +54,27 @@ module Pod Dir.chdir(source_dir) end + + it "adds a build user-setting that enables bitcode compilation" do + source_dir = Dir.pwd + + Pod::Config.instance.sources_manager.stubs(:search).returns(nil) + + command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec -dynamic}) + t, w = command.send(:create_working_directory) + + command.config.installation_root = Pathname.new(w) + command.config.sandbox_root = 'Pods' + + static_sandbox = command.send(:build_static_sandbox, true) + static_installer = command.send(:install_pod, :ios, static_sandbox) + + dynamic_sandbox = command.send(:build_dynamic_sandbox, static_sandbox, static_installer) + dynamic_project = command.send(:install_dynamic_pod, dynamic_sandbox, static_sandbox, static_installer) + + dynamic_project.targets.first.build_configuration_list.build_configurations.each do |config| + config.build_settings['BITCODE_GENERATION_MODE'].should.equal("bitcode") + end + end end end