Commit c2579913 authored by Marius Rackwitz's avatar Marius Rackwitz

[Analyzer] Simplify logic in #generate_pod_targets

parent 9857fee7
......@@ -299,16 +299,9 @@ module Pod
end
pod_targets = distinct_targets.flat_map do |_root, target_definitions_by_variant|
if target_definitions_by_variant.count > 1
# There are different sets of subspecs or the spec is used across different platforms
hash = Hash[array]
suffixes = PodVariantSet.new(hash.keys).scope_suffixes
hash.flat_map do |variant, target_definitions|
generate_pod_target(target_definitions, variant.specs, :scope_suffix => suffixes[variant])
end
else
variant, target_definitions = *array.first
generate_pod_target(target_definitions, variant.specs)
suffixes = PodVariantSet.new(target_definitions_by_variant.keys).scope_suffixes
target_definitions_by_variant.flat_map do |variant, target_definitions|
generate_pod_target(target_definitions, variant.specs, :scope_suffix => suffixes[variant])
end
end
else
......
......@@ -9,6 +9,11 @@ module Pod
PodVariant = Pod::Installer::Analyzer::PodVariant.freeze
it 'returns an empty scope if there is only one variant' do
variants = PodVariantSet.new([PodVariant.new([@root_spec], Platform.ios)])
variants.scope_suffixes.values.should == [nil]
end
it 'returns scopes by built types if they qualify' do
variants = PodVariantSet.new([
PodVariant.new([@root_spec], Platform.ios, true),
......
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