Commit d7fad64b authored by Eloy Duran's avatar Eloy Duran

Add a quick and dirty way to create a xcconfig file that the app bases its…

Add a quick and dirty way to create a xcconfig file that the app bases its target configurations on.
parent 210c1c8e
...@@ -82,16 +82,8 @@ module Pod ...@@ -82,16 +82,8 @@ module Pod
dep dep
end end
#def xcconfig(path) def xcconfig(hash)
#@xcconfig = path @xcconfig = hash
#end
def frameworks(*frameworks)
@frameworks = frameworks.map { |f| Pathname.new(f) }
end
def header_search_paths(*search_paths)
@header_search_paths = search_paths
end end
# Not attributes # Not attributes
...@@ -103,6 +95,8 @@ module Pod ...@@ -103,6 +95,8 @@ module Pod
end end
end end
# TODO move this all to an Installer class
# This also includes those that are only part of other specs, but are not # This also includes those that are only part of other specs, but are not
# actually being used themselves. # actually being used themselves.
def resolved_dependent_specification_sets def resolved_dependent_specification_sets
...@@ -121,6 +115,7 @@ module Pod ...@@ -121,6 +115,7 @@ module Pod
def create_static_library_project! def create_static_library_project!
puts "==> Creating static library project" puts "==> Creating static library project"
xcconfigs = []
project = XcodeProject.static_library project = XcodeProject.static_library
resolved_dependent_specification_sets.each do |set| resolved_dependent_specification_sets.each do |set|
# In case the set is only part of other pods we don't need to build # In case the set is only part of other pods we don't need to build
...@@ -138,15 +133,35 @@ module Pod ...@@ -138,15 +133,35 @@ module Pod
end end
end end
if frameworks = spec.read(:frameworks) if xcconfig = spec.read(:xcconfig)
frameworks.each { |framework| project.add_framework(framework) } xcconfigs << xcconfig
end end
end
project.create_in(config.project_pods_root)
if search_paths = spec.read(:header_search_paths) # TODO the static library needs an extra xcconfig which sets the values from issue #1.
search_paths.each { |path| project.add_header_search_path(path) } # Or we could edit the project.pbxproj file, but that seems like more work...
merged_xcconfig = {
# in a workspace this is where the static library headers should be found
'USER_HEADER_SEARCH_PATHS' => '$(BUILT_PRODUCTS_DIR)',
# search the user headers
'ALWAYS_SEARCH_USER_PATHS' => 'YES',
}
xcconfigs.each do |xcconfig|
xcconfig.each do |key, value|
if existing_value = merged_xcconfig[key]
merged_xcconfig[key] = "#{existing_value} #{value}"
else
merged_xcconfig[key] = value
end
end
end
(config.project_pods_root + 'Pods.xcconfig').open('w') do |file|
merged_xcconfig.each do |key, value|
file.puts "#{key} = #{value}"
end end
end end
project.create_in(config.project_pods_root)
end end
include Config::Mixin include Config::Mixin
......
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