Commit 563225d1 authored by Boris Bügling's avatar Boris Bügling

Merge pull request #3206 from CocoaPods/fix-static-binaries-check

Fix static binaries check
parents 2e081a3c dba419fb
...@@ -21,6 +21,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -21,6 +21,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[#3212](https://github.com/CocoaPods/CocoaPods/issues/3212) [#3212](https://github.com/CocoaPods/CocoaPods/issues/3212)
* Limit the check for transitive static binaries to those which are directly linked to the user target.
[Boris Bügling](https://github.com/neonichu)
[#3194](https://github.com/CocoaPods/CocoaPods/issues/3194)
## 0.36.0.rc.1 ## 0.36.0.rc.1
......
...@@ -355,7 +355,7 @@ module Pod ...@@ -355,7 +355,7 @@ module Pod
pod_targets = aggregate_target.pod_targets_for_build_configuration(config) pod_targets = aggregate_target.pod_targets_for_build_configuration(config)
dependencies = pod_targets.flat_map(&:dependencies) dependencies = pod_targets.flat_map(&:dependencies)
dependended_upon_targets = pod_targets.select { |t| dependencies.include?(t.pod_name) } dependended_upon_targets = pod_targets.select { |t| dependencies.include?(t.pod_name) && !t.should_build? }
static_libs = dependended_upon_targets.flat_map(&:file_accessors).flat_map do |fa| static_libs = dependended_upon_targets.flat_map(&:file_accessors).flat_map do |fa|
static_frameworks = fa.vendored_frameworks.reject { |fw| `file #{fw + fw.basename('.framework')} 2>&1` =~ /dynamically linked/ } static_frameworks = fa.vendored_frameworks.reject { |fw| `file #{fw + fw.basename('.framework')} 2>&1` =~ /dynamically linked/ }
......
...@@ -172,11 +172,11 @@ module Pod ...@@ -172,11 +172,11 @@ module Pod
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
describe '#verify_no_static_framework_transitive_dependencies' do describe '#verify_no_static_framework_transitive_dependencies' do
it 'detects transitive static dependencies' do before do
Sandbox::FileAccessor.any_instance.stubs(:vendored_libraries).returns([Pathname('libThing.a')])
fixture_path = ROOT + 'spec/fixtures' fixture_path = ROOT + 'spec/fixtures'
config.repos_dir = fixture_path + 'spec-repos' config.repos_dir = fixture_path + 'spec-repos'
podfile = Pod::Podfile.new do config.integrate_targets = false
@podfile = Pod::Podfile.new do
platform :ios, '8.0' platform :ios, '8.0'
xcodeproj 'SampleProject/SampleProject' xcodeproj 'SampleProject/SampleProject'
use_frameworks! use_frameworks!
...@@ -184,12 +184,21 @@ module Pod ...@@ -184,12 +184,21 @@ module Pod
pod 'OrangeFramework', :path => (fixture_path + 'orange-framework').to_s pod 'OrangeFramework', :path => (fixture_path + 'orange-framework').to_s
pod 'monkey', :path => (fixture_path + 'monkey').to_s pod 'monkey', :path => (fixture_path + 'monkey').to_s
end end
lockfile = generate_lockfile @lockfile = generate_lockfile
config.integrate_targets = false end
@installer = Installer.new(config.sandbox, podfile, lockfile) it 'detects transitive static dependencies which are linked directly to the user target' do
Sandbox::FileAccessor.any_instance.stubs(:vendored_libraries).returns([Pathname('/libThing.a')])
@installer = Installer.new(config.sandbox, @podfile, @lockfile)
should.raise(Informative) { @installer.install! }.message.should.match /transitive.*libThing/ should.raise(Informative) { @installer.install! }.message.should.match /transitive.*libThing/
end end
it 'allows transitive static dependencies which contain other source code' do
Sandbox::FileAccessor.any_instance.stubs(:source_files).returns([Pathname('/yolo.m')])
Sandbox::FileAccessor.any_instance.stubs(:vendored_libraries).returns([Pathname('/libThing.a')])
@installer = Installer.new(config.sandbox, @podfile, @lockfile)
should.not.raise(Informative) { @installer.install! }
end
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
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