Commit e0ff376b authored by Marius Rackwitz's avatar Marius Rackwitz

[Analyzer] Make platform suffixes more consistent

… and error-prone by avoiding spaces in target labels, which are used to compose file paths.
parent 25398b86
......@@ -353,10 +353,10 @@ module Pod
all_platform_name_variants = all_platform_variants.map(&:name)
if all_platform_name_variants.uniq.count == all_platform_name_variants.count
# => Platform name
result = targets_by_distinctors.map { |d, _| [d, d[1].name.to_s] }
result = targets_by_distinctors.map { |d, _| [d, Platform.string_name(d[1].symbolic_name).tr(' ', '')] }
else
# => Platform name + SDK version
result = targets_by_distinctors.map { |d, _| [d, d[1].to_s] }
result = targets_by_distinctors.map { |d, _| [d, d[1].to_s.tr(' ', '')] }
end
elsif all_spec_variants.uniq.count == all_spec_variants.count
common_specs = all_spec_variants.reduce(all_spec_variants.first, &:&)
......
......@@ -142,7 +142,7 @@ module Pod
[[@root_spec], Platform.ios] => [@target_definitions[0]],
[[@root_spec], Platform.osx] => [@target_definitions[1]],
}
@analyzer.send(:scope_suffix_for_distinctor, specs).values.should == %w(ios osx)
@analyzer.send(:scope_suffix_for_distinctor, specs).values.should == %w(iOS OSX)
end
it 'returns scopes by versioned platform names if they qualify' do
......@@ -150,7 +150,7 @@ module Pod
[[@root_spec], Platform.ios] => [@target_definitions[0]],
[[@root_spec], Platform.new(:ios, '7.0')] => [@target_definitions[1]],
}
@analyzer.send(:scope_suffix_for_distinctor, specs).values.should == ['iOS', 'iOS 7.0']
@analyzer.send(:scope_suffix_for_distinctor, specs).values.should == ['iOS', 'iOS7.0']
end
it 'returns scopes by subspec names if they qualify' do
......@@ -288,11 +288,11 @@ module Pod
analyzer.analyze
analyzer.analyze.targets.flat_map { |at| at.pod_targets.map { |pt| "#{at.name}/#{pt.name}" } }.sort.should == %w(
Pods-CLITool/monkey-osx
Pods-CLITool/monkey-OSX
Pods-SampleProject-TestRunner/BananaLib-Pods-SampleProject-TestRunner
Pods-SampleProject-TestRunner/monkey-ios
Pods-SampleProject-TestRunner/monkey-iOS
Pods-SampleProject/BananaLib-Pods-SampleProject
Pods-SampleProject/monkey-ios
Pods-SampleProject/monkey-iOS
).sort
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