Commit 5ee56930 authored by Marius Rackwitz's avatar Marius Rackwitz

[PodVariantSet] Make specs first priority

parent 186c43dd
......@@ -21,7 +21,7 @@ module Pod
#
def scope_suffixes
return { variants.first => nil } if variants.count == 1
scope_by_build_type
scope_by_specs
end
# Groups the collection by result of the block.
......@@ -83,7 +83,7 @@ module Pod
# => Platform name + SDK version
platform_name_proc = proc { |v| v.platform.to_s.tr(' ', '') }
end
scope_if_necessary(grouped_variants.map(&:scope_by_specs), &platform_name_proc)
scope_if_necessary(grouped_variants.map(&:scope_without_suffix), &platform_name_proc)
end
# @private
......@@ -93,7 +93,7 @@ module Pod
grouped_variants = group_by(&:specs)
all_spec_variants = grouped_variants.map { |set| set.variants.first.specs }
common_specs = all_spec_variants.reduce(all_spec_variants.first, &:&)
scope_if_necessary(grouped_variants.map(&:scope_without_suffix)) do |variant|
scope_if_necessary(grouped_variants.map(&:scope_by_build_type)) do |variant|
subspecs = variant.specs - common_specs
subspec_names = subspecs.map do |spec|
spec.root? ? 'root' : spec.name.split('/')[1..-1].join('_')
......
......@@ -61,22 +61,22 @@ module Pod
it 'returns scopes by platform names and subspec names if they qualify' do
variants = PodVariantSet.new([
PodVariant.new([@root_spec], Platform.ios),
PodVariant.new([@root_spec, @foo_subspec], Platform.ios),
PodVariant.new([@root_spec], Platform.osx),
PodVariant.new([@root_spec, @foo_subspec], Platform.ios),
PodVariant.new([@root_spec, @bar_subspec], Platform.osx),
])
variants.scope_suffixes.values.should == [
'iOS',
'iOS-Foo',
'OSX',
'OSX-Bar',
'Foo',
'Bar',
]
end
it 'returns scopes by versioned platform names and subspec names if they qualify' do
variants = PodVariantSet.new([
PodVariant.new([@root_spec], Platform.new(:ios, '7.0')),
PodVariant.new([@root_spec, @foo_subspec], Platform.ios),
PodVariant.new([@root_spec], Platform.ios),
PodVariant.new([@root_spec], Platform.osx),
PodVariant.new([@root_spec, @bar_subspec], Platform.osx),
])
......@@ -84,7 +84,7 @@ module Pod
'iOS7.0',
'iOS',
'OSX',
'OSX-Bar',
'Bar',
]
end
......@@ -93,13 +93,15 @@ module Pod
PodVariant.new([@root_spec], Platform.new(:ios, '7.0')),
PodVariant.new([@root_spec], Platform.ios),
PodVariant.new([@root_spec], Platform.osx, true),
PodVariant.new([@root_spec, @foo_subspec], Platform.ios),
PodVariant.new([@root_spec, @foo_subspec], Platform.osx, true),
])
variants.scope_suffixes.values.should == [
'library-iOS7.0',
'library-iOS',
'framework',
'framework-Foo',
'Foo-library',
'Foo-framework',
]
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