Commit 5a83b0ee authored by Carson McDonald's avatar Carson McDonald

Handle ARCHS coming back as an Array or String

parent 9b51eb14
...@@ -66,6 +66,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -66,6 +66,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Joshua Kalpin](https://github.com/Kapin) [Joshua Kalpin](https://github.com/Kapin)
[Core#44](https://github.com/CocoaPods/Core/issues/44) [Core#44](https://github.com/CocoaPods/Core/issues/44)
* The ARCHS build setting can come back as an array when more than one
architecture is specified.
[Carson McDonald](https://github.com/carsonmcdonald)
[#1628](https://github.com/CocoaPods/CocoaPods/issues/1628)
## 0.28.0 ## 0.28.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0)
......
...@@ -461,7 +461,8 @@ module Pod ...@@ -461,7 +461,8 @@ module Pod
def compute_archs_for_target_definition(target_definition, user_targets) def compute_archs_for_target_definition(target_definition, user_targets)
archs = [] archs = []
user_targets.each do |target| user_targets.each do |target|
archs << target.common_resolved_build_setting('ARCHS') target_archs = target.common_resolved_build_setting('ARCHS')
archs.concat(Array(target_archs))
end end
archs = archs.compact.uniq.sort archs = archs.compact.uniq.sort
......
...@@ -331,6 +331,68 @@ module Pod ...@@ -331,6 +331,68 @@ module Pod
#--------------------------------------# #--------------------------------------#
describe "#compute_archs_for_target_definition" do
it "handles a single ARCH defined in a single user target" do
user_project = Xcodeproj::Project.new('path')
target = user_project.new_target(:application, 'Target', :ios)
target.build_configuration_list.set_setting('ARCHS', 'armv7')
target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '4.0')
user_targets = [target]
archs = @analyzer.send(:compute_archs_for_target_definition, target_definition, user_targets)
archs.should == 'armv7'
end
it "handles a single ARCH defined in multiple user targets" do
user_project = Xcodeproj::Project.new('path')
targeta = user_project.new_target(:application, 'Target', :ios)
targeta.build_configuration_list.set_setting('ARCHS', 'armv7')
targetb = user_project.new_target(:application, 'Target', :ios)
targetb.build_configuration_list.set_setting('ARCHS', 'armv7')
target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '4.0')
user_targets = [targeta, targetb]
archs = @analyzer.send(:compute_archs_for_target_definition, target_definition, user_targets)
archs.should == 'armv7'
end
it "handles an Array of ARCHs defined in a single user target" do
user_project = Xcodeproj::Project.new('path')
target = user_project.new_target(:application, 'Target', :ios)
target.build_configuration_list.set_setting('ARCHS', 'armv7')
target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '4.0')
user_targets = [target]
archs = @analyzer.send(:compute_archs_for_target_definition, target_definition, user_targets)
archs.should == 'armv7'
end
it "handles an Array of ARCHs defined multiple user targets" do
user_project = Xcodeproj::Project.new('path')
targeta = user_project.new_target(:application, 'Target', :ios)
targeta.build_configuration_list.set_setting('ARCHS', 'armv7')
targetb = user_project.new_target(:application, 'Target', :ios)
targetb.build_configuration_list.set_setting('ARCHS', ['armv7', 'i386'])
target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '4.0')
user_targets = [targeta, targetb]
archs = @analyzer.send(:compute_archs_for_target_definition, target_definition, user_targets)
archs.should == 'armv7'
end
end
#--------------------------------------#
describe "#compute_platform_for_target_definition" do describe "#compute_platform_for_target_definition" do
it "returns the platform specified in the target definition" do it "returns the platform specified in the target definition" do
......
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