Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-3409 - Adds Bitcode Support Back to XCode >=8.3 #201

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/cocoapods-packager/pod_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions spec/pod/utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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