Commit f051e278 authored by Marius Rackwitz's avatar Marius Rackwitz

[Target] Ensure that Target#archs is always initialized as array

parent 0c7f0228
...@@ -67,7 +67,7 @@ module Pod ...@@ -67,7 +67,7 @@ module Pod
def custom_build_settings def custom_build_settings
settings = {} settings = {}
unless target.nil? || target.archs.empty? unless target.archs.empty?
settings['ARCHS'] = target.archs settings['ARCHS'] = target.archs
end end
......
...@@ -16,6 +16,12 @@ module Pod ...@@ -16,6 +16,12 @@ module Pod
attr_accessor :host_requires_frameworks attr_accessor :host_requires_frameworks
alias_method :host_requires_frameworks?, :host_requires_frameworks alias_method :host_requires_frameworks?, :host_requires_frameworks
# Initialize a new target
#
def initialize
@archs = []
end
# @return [String] the name of the library. # @return [String] the name of the library.
# #
def name def name
...@@ -105,7 +111,7 @@ module Pod ...@@ -105,7 +111,7 @@ module Pod
# #
attr_accessor :native_target attr_accessor :native_target
# @return [String] The value for the ARCHS build setting. # @return [Array<String>] The value for the ARCHS build setting.
# #
attr_accessor :archs attr_accessor :archs
......
...@@ -13,6 +13,7 @@ module Pod ...@@ -13,6 +13,7 @@ module Pod
# @param [Sandbox] sandbox @see sandbox # @param [Sandbox] sandbox @see sandbox
# #
def initialize(target_definition, sandbox) def initialize(target_definition, sandbox)
super()
@target_definition = target_definition @target_definition = target_definition
@sandbox = sandbox @sandbox = sandbox
@pod_targets = [] @pod_targets = []
......
...@@ -41,6 +41,7 @@ module Pod ...@@ -41,6 +41,7 @@ module Pod
def initialize(specs, target_definitions, sandbox, scoped = false) def initialize(specs, target_definitions, sandbox, scoped = false)
raise "Can't initialize a PodTarget without specs!" if specs.nil? || specs.empty? raise "Can't initialize a PodTarget without specs!" if specs.nil? || specs.empty?
raise "Can't initialize a PodTarget without TargetDefinition!" if target_definitions.nil? || target_definitions.empty? raise "Can't initialize a PodTarget without TargetDefinition!" if target_definitions.nil? || target_definitions.empty?
super()
@specs = specs @specs = specs
@target_definitions = target_definitions @target_definitions = target_definitions
@sandbox = sandbox @sandbox = sandbox
......
...@@ -13,6 +13,10 @@ module Pod ...@@ -13,6 +13,10 @@ module Pod
@target.target_definition.should == @target_definition @target.target_definition.should == @target_definition
end end
it 'is initialized with empty archs' do
@target.archs.should == []
end
it 'returns the label of the target definition' do it 'returns the label of the target definition' do
@target.label.should == 'Pods' @target.label.should == 'Pods'
end end
......
...@@ -24,6 +24,10 @@ module Pod ...@@ -24,6 +24,10 @@ module Pod
@pod_target.target_definitions.should == [@target_definition] @pod_target.target_definitions.should == [@target_definition]
end end
it 'is initialized with empty archs' do
@pod_target.archs.should == []
end
it 'returns its name' do it 'returns its name' do
@pod_target.name.should == 'BananaLib' @pod_target.name.should == 'BananaLib'
@pod_target.scoped.first.name.should == 'Pods-BananaLib' @pod_target.scoped.first.name.should == 'Pods-BananaLib'
......
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