Commit 0d918ae8 authored by Marius Rackwitz's avatar Marius Rackwitz

[Installer] Fix architecture determination

parent ac87bcf3
...@@ -369,7 +369,7 @@ module Pod ...@@ -369,7 +369,7 @@ module Pod
if config.integrate_targets? if config.integrate_targets?
target_inspections = result.target_inspections.select { |t, _| target_definitions.include?(t) }.values target_inspections = result.target_inspections.select { |t, _| target_definitions.include?(t) }.values
pod_target.user_build_configurations = target_inspections.map(&:build_configurations).reduce({}, &:merge) pod_target.user_build_configurations = target_inspections.map(&:build_configurations).reduce({}, &:merge)
pod_target.archs = target_inspections.map(&:archs).uniq.sort pod_target.archs = target_inspections.flat_map(&:archs).compact.uniq.sort
else else
pod_target.user_build_configurations = {} pod_target.user_build_configurations = {}
if target_definitions.first.platform.name == :osx if target_definitions.first.platform.name == :osx
...@@ -651,7 +651,10 @@ module Pod ...@@ -651,7 +651,10 @@ module Pod
inspection_result = {} inspection_result = {}
UI.section 'Inspecting targets to integrate' do UI.section 'Inspecting targets to integrate' do
podfile.target_definition_list.each do |target_definition| podfile.target_definition_list.each do |target_definition|
inspection_result[target_definition] = TargetInspector.new(target_definition).inspect! results = TargetInspector.new(target_definition).inspect!
inspection_result[target_definition] = results
UI.message('Using `ARCHS` setting to build architectures of ' \
"target `#{target_definition.label}`: (`#{results.archs.join('`, `')}`)")
end end
end end
inspection_result inspection_result
......
...@@ -155,14 +155,9 @@ module Pod ...@@ -155,14 +155,9 @@ module Pod
# @return [Array<String>] # @return [Array<String>]
# #
def compute_archs(user_targets) def compute_archs(user_targets)
archs = user_targets.flat_map do |target| user_targets.flat_map do |target|
Array(target.common_resolved_build_setting('ARCHS')) Array(target.common_resolved_build_setting('ARCHS'))
end.compact.uniq.sort end.compact.uniq.sort
UI.message('Using `ARCHS` setting to build architectures of ' \
"target `#{target_definition.label}`: " \
"(`#{archs.join('`, `')}`)")
archs.length > 1 ? archs : archs.first
end end
# Checks if any of the targets for the {TargetDefinition} computed before # Checks if any of the targets for the {TargetDefinition} computed before
......
...@@ -67,7 +67,7 @@ module Pod ...@@ -67,7 +67,7 @@ module Pod
def custom_build_settings def custom_build_settings
settings = {} settings = {}
if target.archs unless target.nil? || target.archs.empty?
settings['ARCHS'] = target.archs settings['ARCHS'] = target.archs
end end
......
...@@ -152,7 +152,7 @@ module Pod ...@@ -152,7 +152,7 @@ module Pod
user_targets = [target] user_targets = [target]
archs = TargetInspector.new(target_definition).send(:compute_archs, user_targets) archs = TargetInspector.new(target_definition).send(:compute_archs, user_targets)
archs.should == 'armv7' archs.should == %w(armv7)
end end
it 'handles a single ARCH defined in multiple user targets' do it 'handles a single ARCH defined in multiple user targets' do
...@@ -167,7 +167,7 @@ module Pod ...@@ -167,7 +167,7 @@ module Pod
user_targets = [targeta, targetb] user_targets = [targeta, targetb]
archs = TargetInspector.new(target_definition).send(:compute_archs, user_targets) archs = TargetInspector.new(target_definition).send(:compute_archs, user_targets)
archs.should == 'armv7' archs.should == %w(armv7)
end end
it 'handles an Array of ARCHs defined in a single user target' do it 'handles an Array of ARCHs defined in a single user target' do
......
...@@ -100,6 +100,8 @@ module Pod ...@@ -100,6 +100,8 @@ module Pod
].sort ].sort
target.support_files_dir.should == config.sandbox.target_support_files_dir('Pods') target.support_files_dir.should == config.sandbox.target_support_files_dir('Pods')
target.pod_targets.map(&:archs).uniq.should == [[]]
target.user_project_path.to_s.should.include 'SampleProject/SampleProject' target.user_project_path.to_s.should.include 'SampleProject/SampleProject'
target.client_root.to_s.should.include 'SampleProject' target.client_root.to_s.should.include 'SampleProject'
target.user_target_uuids.should == ['A346496C14F9BE9A0080D870'] target.user_target_uuids.should == ['A346496C14F9BE9A0080D870']
......
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