Permalink
Browse files

Update to the last head of Xcodeproj.

  • Loading branch information...
1 parent 223ef73 commit 598c743c2834db78abbd94631cc15c3c72069dc5 @fabiopelosin fabiopelosin committed May 28, 2012
Showing with 12 additions and 43 deletions.
  1. +1 −1 Gemfile.lock
  2. +6 −36 lib/cocoapods/specification.rb
  3. +5 −6 spec/unit/specification_spec.rb
View
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/CocoaPods/Xcodeproj.git
- revision: df3520d5c124ab23d411199f2c41a135801ec39c
+ revision: 7a8e4564740aea026e4605d678981b2c4cd9690e
specs:
xcodeproj (0.1.0)
@@ -195,55 +195,25 @@ def self.parse_authors(*names_and_email_addresses)
pltf_chained_attr_accessor :resources, lambda {|value, current| pattern_list(value) }
pltf_chained_attr_accessor :preserve_paths, lambda {|value, current| pattern_list(value) } # Paths that should not be cleaned
pltf_chained_attr_accessor :exclude_header_search_paths, lambda {|value, current| pattern_list(value) } # Headers to be excluded from being added to search paths (RestKit)
- pltf_chained_attr_accessor :frameworks, lambda {|value, current| current << value }
- pltf_chained_attr_accessor :libraries, lambda {|value, current| current << value }
+ pltf_chained_attr_accessor :frameworks, lambda {|value, current| (current << value).flatten }
+ pltf_chained_attr_accessor :libraries, lambda {|value, current| (current << value).flatten }
alias_method :resource=, :resources=
alias_method :framework=, :frameworks=
alias_method :library=, :libraries=
+ platform_attr_writer :xcconfig, lambda {|value, current| current.tap { |c| c.merge!(value) } }
+
def xcconfig
raw_xconfig.dup.
- tap { |x| x.add_libraries(libraries) }.
- tap { |x| x.add_frameworks(frameworks) }
- end
-
- # TODO: move to Xcodeproj
- class ::Xcodeproj::Config
- # BUG: old implementation would lose keys specified in self
- # but not specified in the passed xcconfig.
- def merge!(xcconfig)
- @attributes.merge!(xcconfig.to_hash) { |key, v1, v2| "#{v1} #{v2}" }
- end
-
- def merge(config)
- self.dup.tap { |x|x.merge!(config) }
- end
-
- def add_libraries(libraries)
- return if libraries.nil? || libraries.empty?
- flags = [ @attributes['OTHER_LDFLAGS'] ] || []
- flags << "-l#{ libraries.join(' -l') }"
- @attributes['OTHER_LDFLAGS'] = flags.compact.map(&:strip).join(' ')
- end
-
- def add_frameworks(frameworks)
- return if frameworks.nil? || frameworks.empty?
- flags = [ @attributes['OTHER_LDFLAGS'] ] || []
- flags << "-framework #{ frameworks.join(' -framework ') }"
- @attributes['OTHER_LDFLAGS'] = flags.compact.map(&:strip).join(' ')
- end
-
- def dup
- Xcodeproj::Config.new(self.to_hash.dup)
- end
+ tap { |x| x.libraries.merge libraries }.
+ tap { |x| x.frameworks.merge frameworks }
end
def raw_xconfig
@parent ? @parent.raw_xconfig.merge(@xcconfig[active_platform]) : @xcconfig[active_platform]
end
- platform_attr_writer :xcconfig, lambda {|value, current| current.tap { |c| c.merge!(value) } }
def compiler_flags
if @parent
@@ -74,16 +74,15 @@
it "has a shortcut to add frameworks to the xcconfig" do
@spec.frameworks = 'CFNetwork', 'CoreText'
@spec.activate_platform(:ios).xcconfig.should == {
- 'OTHER_LDFLAGS' => '-framework SystemConfiguration ' \
- '-framework CFNetwork ' \
- '-framework CoreText'
- }
+ 'OTHER_LDFLAGS' => '-framework CFNetwork ' \
+ '-framework CoreText ' \
+ '-framework SystemConfiguration' }
end
it "has a shortcut to add libraries to the xcconfig" do
@spec.libraries = 'z', 'xml2'
@spec.activate_platform(:ios).xcconfig.should == {
- 'OTHER_LDFLAGS' => '-framework SystemConfiguration -lz -lxml2'
+ 'OTHER_LDFLAGS' => '-lxml2 -lz -framework SystemConfiguration'
}
end
@@ -548,7 +547,7 @@
it "returns a different list of xcconfig build settings for each platform" do
@spec.activate_platform(:ios).xcconfig.should == { 'OTHER_LDFLAGS' => '-lObjC -lz -framework QuartzCore' }
- @spec.activate_platform(:osx).xcconfig.should == { 'OTHER_LDFLAGS' => '-lObjC -all_load -lz -lxml -framework QuartzCore -framework CoreData' }
+ @spec.activate_platform(:osx).xcconfig.should == { 'OTHER_LDFLAGS' => '-all_load -lObjC -lxml -lz -framework CoreData -framework QuartzCore' }
end
it "returns the list of the supported platfroms and deployment targets" do

0 comments on commit 598c743

Please sign in to comment.