Commit 108dc513 authored by Danielle Tomlinson's avatar Danielle Tomlinson Committed by GitHub

Merge pull request #6216 from benasher44/basher_fix_cross_project_frameworks

Fix cross-project framework dependencies
parents ef5d6e1d fcef7834
...@@ -44,6 +44,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -44,6 +44,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Danielle Tomlinson](https://github.com/dantoml) [Danielle Tomlinson](https://github.com/dantoml)
[#6078](https://github.com/CocoaPods/CocoaPods/issues/6078) [#6078](https://github.com/CocoaPods/CocoaPods/issues/6078)
* Fix framework support for frameworks in sub-projects.
[Ben Asher](https://github.com/benasher44)
[#6123](https://github.com/CocoaPods/CocoaPods/issues/6123)
## 1.2.0.beta.1 (2016-10-28) ## 1.2.0.beta.1 (2016-10-28)
......
...@@ -238,18 +238,21 @@ module Pod ...@@ -238,18 +238,21 @@ module Pod
# #
def copy_embedded_target_pod_targets_to_host(aggregate_target, embedded_aggregate_targets) def copy_embedded_target_pod_targets_to_host(aggregate_target, embedded_aggregate_targets)
return if aggregate_target.requires_host_target? return if aggregate_target.requires_host_target?
# Get the uuids of the aggregate_target's user_targets' embedded targets if any pod_target_names = Set.new(aggregate_target.pod_targets.map(&:name))
embedded_uuids = Set.new(aggregate_target.user_targets.map do |target| aggregate_user_target_uuids = Set.new(aggregate_target.user_targets.map(&:uuid))
aggregate_target.user_project.embedded_targets_in_native_target(target).map(&:uuid) embedded_aggregate_targets.each do |embedded_aggregate_target|
end.flatten) next unless embedded_aggregate_target.user_targets.any? do |embedded_user_target|
return if embedded_uuids.empty? # You have to ask the host target's project for the host targets of
embedded_aggregate_targets.each do |embedded_target| # the embedded target, as opposed to asking user_project for the
next unless embedded_target.user_targets.map(&:uuid).any? do |embedded_uuid| # embedded targets of the host target. The latter doesn't work when
embedded_uuids.include? embedded_uuid # the embedded target lives in a sub-project. The lines below get
# the host target uuids for the embedded target and checks to see if
# those match to any of the user_target uuids in the aggregate_target.
host_target_uuids = Set.new(aggregate_target.user_project.host_targets_for_embedded_target(embedded_user_target).map(&:uuid))
!aggregate_user_target_uuids.intersection(host_target_uuids).empty?
end end
pod_target_names = aggregate_target.pod_targets.map(&:name)
# This embedded target is hosted by the aggregate target's user_target; copy over the non-duplicate pod_targets # This embedded target is hosted by the aggregate target's user_target; copy over the non-duplicate pod_targets
aggregate_target.pod_targets = aggregate_target.pod_targets + embedded_target.pod_targets.select do |pod_target| aggregate_target.pod_targets = aggregate_target.pod_targets + embedded_aggregate_target.pod_targets.select do |pod_target|
!pod_target_names.include? pod_target.name !pod_target_names.include? pod_target.name
end end
end end
......
...@@ -753,7 +753,9 @@ module Pod ...@@ -753,7 +753,9 @@ module Pod
platform :ios, '8.0' platform :ios, '8.0'
project 'SampleProject/SampleProject' project 'SampleProject/SampleProject'
target 'SampleProject' target 'SampleProject' do
pod 'JSONKit'
end
target 'Sample Framework' do target 'Sample Framework' do
project 'SampleProject/Sample Lib/Sample Lib' project 'SampleProject/Sample Lib/Sample Lib'
...@@ -763,9 +765,10 @@ module Pod ...@@ -763,9 +765,10 @@ module Pod
analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile) analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile)
result = analyzer.analyze result = analyzer.analyze
result.targets.flat_map { |at| at.pod_targets.map { |pt| "#{at.name}/#{pt.name}" } }.sort.should == [ result.targets.select { |at| at.name == 'Pods-SampleProject' }.flat_map(&:pod_targets).map(&:name).sort.uniq.should == %w(
'Pods-Sample Framework/monkey', JSONKit
].sort monkey
).sort
end end
it "raises when unable to find an extension's host target" do it "raises when unable to find an extension's host target" do
......
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