Do not link system frameworks of test specs to library targets

parent e375d31c
...@@ -14,6 +14,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -14,6 +14,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Do not link system frameworks of test specs to library targets
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7205](https://github.com/CocoaPods/CocoaPods/pull/7205)
* Be more lenient when stripping frameworks and dSYMs for non fat binaries * Be more lenient when stripping frameworks and dSYMs for non fat binaries
[Dimitris Koutsogiorgas](https://github.com/dnkoutso) [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7196](https://github.com/CocoaPods/CocoaPods/issues/7196) [#7196](https://github.com/CocoaPods/CocoaPods/issues/7196)
......
...@@ -192,13 +192,14 @@ module Pod ...@@ -192,13 +192,14 @@ module Pod
def add_system_framework_dependencies def add_system_framework_dependencies
# @TODO: Add Specs # @TODO: Add Specs
pod_targets.sort_by(&:name).each do |pod_target| pod_targets.select(&:should_build?).sort_by(&:name).each do |pod_target|
pod_target.file_accessors.each do |file_accessor| test_file_accessors, file_accessors = pod_target.file_accessors.partition { |fa| fa.spec.test_specification? }
file_accessor.spec_consumer.frameworks.each do |framework| file_accessors.each do |file_accessor|
if pod_target.should_build? add_system_frameworks_to_native_target(file_accessor, pod_target.native_target)
pod_target.native_target.add_system_framework(framework) end
end test_file_accessors.each do |test_file_accessor|
end native_target = pod_target.native_target_for_spec(test_file_accessor.spec)
add_system_frameworks_to_native_target(test_file_accessor, native_target)
end end
end end
end end
...@@ -315,6 +316,12 @@ module Pod ...@@ -315,6 +316,12 @@ module Pod
end end
end end
def add_system_frameworks_to_native_target(file_accessor, native_target)
file_accessor.spec_consumer.frameworks.each do |framework|
native_target.add_system_framework(framework)
end
end
def add_resource_bundles_to_native_target(dependent_target, native_target) def add_resource_bundles_to_native_target(dependent_target, native_target)
resource_bundle_targets = dependent_target.resource_bundle_targets + dependent_target.test_resource_bundle_targets resource_bundle_targets = dependent_target.resource_bundle_targets + dependent_target.test_resource_bundle_targets
resource_bundle_targets.each do |resource_bundle_target| resource_bundle_targets.each do |resource_bundle_target|
......
...@@ -131,6 +131,7 @@ module Pod ...@@ -131,6 +131,7 @@ module Pod
it 'install the targets of the Pod project' do it 'install the targets of the Pod project' do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '8.0')
target_definition.abstract = false target_definition.abstract = false
target_definition.store_pod('BananaLib') target_definition.store_pod('BananaLib')
pod_target = PodTarget.new([spec], [target_definition], config.sandbox) pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
...@@ -143,6 +144,7 @@ module Pod ...@@ -143,6 +144,7 @@ module Pod
it 'does not skip empty pod targets' do it 'does not skip empty pod targets' do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '8.0')
target_definition.abstract = false target_definition.abstract = false
pod_target = PodTarget.new([spec], [target_definition], config.sandbox) pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
@generator.stubs(:aggregate_targets).returns([]) @generator.stubs(:aggregate_targets).returns([])
......
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