Commit c3821aa3 authored by Kyle Fuller's avatar Kyle Fuller

Merge pull request #3164 from CocoaPods/check-watch-extension

Configure as extension only for watch extensions
parents 20c47761 b932b8e2
...@@ -8,6 +8,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -8,6 +8,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements ##### Enhancements
* Set the `APPLICATION_EXTENSION_API_ONLY` build setting if integrating with a watch extension target.
[Boris Bügling](https://github.com/neonichu)
[#3153](https://github.com/CocoaPods/CocoaPods/issues/3153)
* Build for iOS simulator only during validation. This allows validation without having * Build for iOS simulator only during validation. This allows validation without having
provisioning profiles set up. provisioning profiles set up.
[Boris Bügling](https://github.com/neonichu) [Boris Bügling](https://github.com/neonichu)
......
...@@ -485,7 +485,8 @@ module Pod ...@@ -485,7 +485,8 @@ module Pod
def set_target_dependencies def set_target_dependencies
frameworks_group = pods_project.frameworks_group frameworks_group = pods_project.frameworks_group
aggregate_targets.each do |aggregate_target| aggregate_targets.each do |aggregate_target|
is_app_extension = aggregate_target.user_targets.map(&:symbol_type).include?(:app_extension) is_app_extension = !(aggregate_target.user_targets.map(&:symbol_type) &
[:app_extension, :watch_extension]).empty?
aggregate_target.pod_targets.each do |pod_target| aggregate_target.pod_targets.each do |pod_target|
configure_app_extension_api_only_for_target(aggregate_target) if is_app_extension configure_app_extension_api_only_for_target(aggregate_target) if is_app_extension
......
...@@ -441,6 +441,19 @@ module Pod ...@@ -441,6 +441,19 @@ module Pod
#--------------------------------------# #--------------------------------------#
describe '#set_target_dependencies' do describe '#set_target_dependencies' do
def test_extension_target(symbol_type)
mock_user_target = mock('UserTarget', :symbol_type => symbol_type)
@target.stubs(:user_targets).returns([mock_user_target])
build_settings = {}
mock_configuration = mock('BuildConfiguration', :build_settings => build_settings)
@mock_target.stubs(:build_configurations).returns([mock_configuration])
@installer.send(:set_target_dependencies)
build_settings.should == { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
end
before do before do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
...@@ -467,16 +480,11 @@ module Pod ...@@ -467,16 +480,11 @@ module Pod
end end
it 'configures APPLICATION_EXTENSION_API_ONLY for app extension targets' do it 'configures APPLICATION_EXTENSION_API_ONLY for app extension targets' do
mock_user_target = mock('UserTarget', :symbol_type => :app_extension) test_extension_target(:app_extension)
@target.stubs(:user_targets).returns([mock_user_target]) end
build_settings = {}
mock_configuration = mock('BuildConfiguration', :build_settings => build_settings)
@mock_target.stubs(:build_configurations).returns([mock_configuration])
@installer.send(:set_target_dependencies)
build_settings.should == { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' } it 'configures APPLICATION_EXTENSION_API_ONLY for watch extension targets' do
test_extension_target(:watch_extension)
end end
it 'does not try to set APPLICATION_EXTENSION_API_ONLY if there are no pod targets' do it 'does not try to set APPLICATION_EXTENSION_API_ONLY if there are no pod targets' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment