Commit 1ed0ca19 authored by Ben Asher's avatar Ben Asher

Fix framework support for cross-project targets

parent ebed6002
......@@ -238,18 +238,14 @@ module Pod
#
def copy_embedded_target_pod_targets_to_host(aggregate_target, embedded_aggregate_targets)
return if aggregate_target.requires_host_target?
# Get the uuids of the aggregate_target's user_targets' embedded targets if any
embedded_uuids = Set.new(aggregate_target.user_targets.map do |target|
aggregate_target.user_project.embedded_targets_in_native_target(target).map(&:uuid)
end.flatten)
return if embedded_uuids.empty?
embedded_aggregate_targets.each do |embedded_target|
next unless embedded_target.user_targets.map(&:uuid).any? do |embedded_uuid|
embedded_uuids.include? embedded_uuid
pod_target_names = aggregate_target.pod_targets.map(&:name)
aggregate_user_target_uuids = Set.new aggregate_target.user_targets.map(&:uuid)
embedded_aggregate_targets.each do |embedded_aggregate_target|
next unless embedded_aggregate_target.user_targets.any? do |embedded_user_target|
!aggregate_user_target_uuids.intersection(Set.new(aggregate_target.user_project.host_targets_for_embedded_target(embedded_user_target).map(&:uuid))).empty?
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
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
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