Skip to content

Commit

Permalink
Merge pull request #4004 from CocoaPods/embed-frameworks-in-app-exten…
Browse files Browse the repository at this point in the history
…sions

Embed frameworks into app and watch extensions.
  • Loading branch information
segiddins committed Aug 17, 2015
2 parents 0de9eca + 895210b commit 4c2395b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -21,6 +21,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Dominique d'Argent](https://github.com/nubbel)
[#3971](https://github.com/CocoaPods/CocoaPods/pull/3971)

* Embed frameworks into app and watch extensions.
[Boris Bügling](https://github.com/neonichu)
[#4004](https://github.com/CocoaPods/CocoaPods/pull/4004)

##### Enhancements

* Collapse the namespaced public and private pod xcconfig into one single
Expand Down
Expand Up @@ -12,7 +12,7 @@ class TargetIntegrator
# @return [Array<Symbol>] the symbol types, which require that the pod
# frameworks are embedded in the output directory / product bundle.
#
EMBED_FRAMEWORK_TARGET_TYPES = [:application, :unit_test_bundle].freeze
EMBED_FRAMEWORK_TARGET_TYPES = [:application, :unit_test_bundle, :app_extension, :watch_extension, :watch2_extension].freeze

# @return [String] the name of the embed frameworks phase
#
Expand Down
Expand Up @@ -116,13 +116,41 @@ module Pod
end

it 'does not add an embed frameworks build phase if the target to integrate is a framework' do
@pod_bundle.stubs(:requires_frameworks? => true)
target = @target_integrator.send(:native_targets).first
target.stubs(:symbol_type).returns(:framework)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == 'Embed Pods Frameworks' }
phase.nil?.should == true
end

it 'adds an embed frameworks build phase if the target to integrate is an app extension' do
@pod_bundle.stubs(:requires_frameworks? => true)
target = @target_integrator.send(:native_targets).first
target.stubs(:symbol_type).returns(:app_extension)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == 'Embed Pods Frameworks' }
phase.nil?.should == false
end

it 'adds an embed frameworks build phase if the target to integrate is a watch extension' do
@pod_bundle.stubs(:requires_frameworks? => true)
target = @target_integrator.send(:native_targets).first
target.stubs(:symbol_type).returns(:watch_extension)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == 'Embed Pods Frameworks' }
phase.nil?.should == false
end

it 'adds an embed frameworks build phase if the target to integrate is a watchOS 2 extension' do
@pod_bundle.stubs(:requires_frameworks? => true)
target = @target_integrator.send(:native_targets).first
target.stubs(:symbol_type).returns(:watch2_extension)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == 'Embed Pods Frameworks' }
phase.nil?.should == false
end

it 'removes existing embed frameworks build phases from integrated framework targets' do
@pod_bundle.stubs(:requires_frameworks? => true)
@target_integrator.integrate!
Expand Down

0 comments on commit 4c2395b

Please sign in to comment.