Commit 932549bb authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #4575 from CocoaPods/fix-duplicate-fwk-check

Unique the list of vendored frameworks.
parents d21d7ec6 b7fe2a14
...@@ -178,6 +178,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -178,6 +178,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
being unable to set the base configuration XCConfig. being unable to set the base configuration XCConfig.
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
* Ensure that linking multiple times against the same framework does not trigger
the duplicate module name check for frameworks.
[Boris Bügling](https://github.com/neonichu)
[Samuel Giddins](https://github.com/segiddins)
[#4550](https://github.com/CocoaPods/CocoaPods/issues/4550)
## 0.39.0 (2015-10-09) ## 0.39.0 (2015-10-09)
......
...@@ -390,7 +390,7 @@ module Pod ...@@ -390,7 +390,7 @@ module Pod
aggregate_targets.each do |aggregate_target| aggregate_targets.each do |aggregate_target|
aggregate_target.user_build_configurations.keys.each do |config| aggregate_target.user_build_configurations.keys.each do |config|
pod_targets = aggregate_target.pod_targets_for_build_configuration(config) pod_targets = aggregate_target.pod_targets_for_build_configuration(config)
vendored_frameworks = pod_targets.flat_map(&:file_accessors).flat_map(&:vendored_frameworks) vendored_frameworks = pod_targets.flat_map(&:file_accessors).flat_map(&:vendored_frameworks).uniq
frameworks = vendored_frameworks.map { |fw| fw.basename('.framework') } frameworks = vendored_frameworks.map { |fw| fw.basename('.framework') }
frameworks += pod_targets.select { |pt| pt.should_build? && pt.requires_frameworks? }.map(&:product_module_name) frameworks += pod_targets.select { |pt| pt.should_build? && pt.requires_frameworks? }.map(&:product_module_name)
......
...@@ -250,7 +250,10 @@ module Pod ...@@ -250,7 +250,10 @@ module Pod
describe '#verify_no_duplicate_framework_names' do describe '#verify_no_duplicate_framework_names' do
it 'detects duplicate framework names' do it 'detects duplicate framework names' do
Sandbox::FileAccessor.any_instance.stubs(:vendored_frameworks).returns([Pathname('monkey.framework')]) Sandbox::FileAccessor.any_instance.stubs(:vendored_frameworks).
returns([Pathname('a/monkey.framework')]).then.
returns([Pathname('b/monkey.framework')]).then.
returns([Pathname('c/monkey.framework')])
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 podfile = Pod::Podfile.new do
...@@ -266,6 +269,25 @@ module Pod ...@@ -266,6 +269,25 @@ module Pod
@installer = Installer.new(config.sandbox, podfile, lockfile) @installer = Installer.new(config.sandbox, podfile, lockfile)
should.raise(Informative) { @installer.install! }.message.should.match /conflict.*monkey/ should.raise(Informative) { @installer.install! }.message.should.match /conflict.*monkey/
end end
it 'allows duplicate references to the same expanded framework path' do
Sandbox::FileAccessor.any_instance.stubs(:vendored_frameworks).returns([fixture('monkey/dynamic-monkey.framework')])
Sandbox::FileAccessor.any_instance.stubs(:dynamic_binary?).returns(true)
fixture_path = ROOT + 'spec/fixtures'
config.repos_dir = fixture_path + 'spec-repos'
podfile = Pod::Podfile.new do
platform :ios, '8.0'
xcodeproj 'SampleProject/SampleProject'
use_frameworks!
pod 'BananaLib', :path => (fixture_path + 'banana-lib').to_s
pod 'monkey', :path => (fixture_path + 'monkey').to_s
end
lockfile = generate_lockfile
config.integrate_targets = false
@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