Commit 235022c9 authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #6877 from abiligiri/duplicate_frameworks

Remove duplicate framework names
parents 5f39a708 142b70bd
......@@ -43,6 +43,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[David Airapetyan](https://github.com/davidair)
[#4887](https://github.com/CocoaPods/CocoaPods/issues/4887)
* Select unique module_name(s) across host target's and embedded targets' pod targets
[Anand Biligiri](https://github.com/abiligiri)
[#6711](https://github.com/CocoaPods/CocoaPods/issues/6711)
## 1.3.0.beta.2 (2017-06-22)
##### Enhancements
......
......@@ -47,7 +47,7 @@ module Pod
file_accessors = pod_targets.flat_map(&:file_accessors)
frameworks = file_accessors.flat_map(&:vendored_frameworks).uniq.map(&:basename)
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).uniq
verify_no_duplicate_names(frameworks, aggregate_target.label, 'frameworks')
libraries = file_accessors.flat_map(&:vendored_libraries).uniq.map(&:basename)
......
......@@ -17,9 +17,9 @@ module Pod
# @return [AnalysisResult]
#
def create_validator(sandbox, podfile, lockfile)
def create_validator(sandbox, podfile, lockfile, integrate_targets = false)
installation_options = Installer::InstallationOptions.new.tap do |options|
options.integrate_targets = false
options.integrate_targets = integrate_targets
end
@analyzer = Analyzer.new(config.sandbox, podfile, lockfile).tap do |analyzer|
......@@ -35,6 +35,10 @@ module Pod
end
describe '#verify_no_duplicate_framework_and_library_names' do
before do
SpecHelper.create_sample_app_copy_from_fixture('Sample Extensions Project')
end
it 'detects duplicate library names' do
Sandbox::FileAccessor.any_instance.stubs(:vendored_libraries).returns([Pathname('a/libBananalib.a')])
Pod::Specification.any_instance.stubs(:dependencies).returns([])
......@@ -92,6 +96,29 @@ module Pod
@validator = create_validator(config.sandbox, podfile, lockfile)
should.not.raise(Informative) { @validator.validate! }
end
it 'including multiple subspecs from the same pod in a target does not result in duplicate frameworks' do
fixture_path = ROOT + 'spec/fixtures'
config.repos_dir = fixture_path + 'spec-repos'
podfile = Pod::Podfile.new do
platform :ios, '9.3'
project 'Sample Extensions Project/Sample Extensions Project'
use_frameworks!
target 'Sample Extensions Project' do
pod 'matryoshka/Foo', :path => (fixture_path + 'matryoshka').to_s
pod 'matryoshka', :path => (fixture_path + 'matryoshka').to_s
end
target 'Today Extension' do
pod 'matryoshka/Foo', :path => (fixture_path + 'matryoshka').to_s
end
end
lockfile = generate_lockfile
@validator = create_validator(config.sandbox, podfile, lockfile, true)
should.not.raise(Informative) { @validator.validate! }
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