Merge pull request #7644 from Liquidsoul/fix/frameworks-search-paths

Prevent duplicated targets from being stripped out from the framework search paths

(cherry picked from commit 15df291f)
parent 207d422a
...@@ -33,6 +33,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -33,6 +33,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Dimitris Koutsogiorgas](https://github.com/dnkoutso) [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7434](https://github.com/CocoaPods/CocoaPods/issues/7434) [#7434](https://github.com/CocoaPods/CocoaPods/issues/7434)
* Prevent duplicated targets from being stripped out from the framework search paths
[Liquidsoul](https://github.com/liquidsoul)
[#7644](https://github.com/CocoaPods/CocoaPods/pull/7644)
## 1.5.0 (2018-04-04) ## 1.5.0 (2018-04-04)
......
...@@ -307,7 +307,7 @@ module Pod ...@@ -307,7 +307,7 @@ module Pod
# Filter out dependent targets that are subsets of another target. # Filter out dependent targets that are subsets of another target.
subset_targets = [] subset_targets = []
dependent_targets.combination(2) do |a, b| dependent_targets.uniq.combination(2) do |a, b|
if (a.specs - b.specs).empty? if (a.specs - b.specs).empty?
subset_targets << a subset_targets << a
elsif (b.specs - a.specs).empty? elsif (b.specs - a.specs).empty?
......
...@@ -83,6 +83,18 @@ module Pod ...@@ -83,6 +83,18 @@ module Pod
build_settings['FRAMEWORK_SEARCH_PATHS'].should == '"AB"' build_settings['FRAMEWORK_SEARCH_PATHS'].should == '"AB"'
end end
it 'adds the frameworks search paths once if there are duplicated targets' do
target = stub(
:specs => %w(A, B),
:should_build? => true,
:requires_frameworks? => true,
:configuration_build_dir => 'AB',
)
dependent_targets = [target, target]
build_settings = @sut.search_paths_for_dependent_targets(nil, dependent_targets)
build_settings['FRAMEWORK_SEARCH_PATHS'].should == '"AB"'
end
it 'adds the libraries of the xcconfig for a static framework' do it 'adds the libraries of the xcconfig for a static framework' do
spec = stub('spec', :test_specification? => false) spec = stub('spec', :test_specification? => false)
target_definition = stub('target_definition', :inheritance => 'search_paths') target_definition = stub('target_definition', :inheritance => 'search_paths')
......
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