Commit 419af929 authored by Eloy Duran's avatar Eloy Duran

Add attributes to specification for frameworks and header_search_paths.

parent 44030731
...@@ -86,6 +86,14 @@ module Pod ...@@ -86,6 +86,14 @@ module Pod
@xcconfig = path @xcconfig = path
end end
def frameworks(*frameworks)
@frameworks = frameworks.map { |f| Pathname.new(f) }
end
def header_search_paths(*search_paths)
@header_search_paths = search_paths
end
# Not attributes # Not attributes
# Returns the specification for the pod that this pod's source is a part of. # Returns the specification for the pod that this pod's source is a part of.
...@@ -113,7 +121,7 @@ module Pod ...@@ -113,7 +121,7 @@ module Pod
def create_static_library! def create_static_library!
puts "==> Creating static library" puts "==> Creating static library"
source_files = [] source_files, frameworks, header_search_paths = [], [], []
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
# the pod itself. # the pod itself.
...@@ -125,6 +133,12 @@ module Pod ...@@ -125,6 +133,12 @@ module Pod
pattern = pattern + '*.{h,m,mm,c,cpp}' if pattern.directory? pattern = pattern + '*.{h,m,mm,c,cpp}' if pattern.directory?
source_files.concat(Dir.glob(pattern.to_s).map { |f| Pathname.new(f) }) source_files.concat(Dir.glob(pattern.to_s).map { |f| Pathname.new(f) })
end end
if f = spec.read(:frameworks)
frameworks.concat(f)
end
if s = spec.read(:header_search_paths)
header_search_paths.concat(s)
end
end end
project = XcodeProject.static_library project = XcodeProject.static_library
...@@ -132,8 +146,8 @@ module Pod ...@@ -132,8 +146,8 @@ module Pod
file = file.relative_path_from(config.project_pods_root) file = file.relative_path_from(config.project_pods_root)
project.add_source_file(file) project.add_source_file(file)
end end
project.add_framework(Pathname.new('usr/lib/libxml2.2.7.3.dylib')) frameworks.each { |framework| project.add_framework(framework) }
project.add_header_search_paths(%w{ $(SDKROOT)/usr/include/libxml2 }) project.add_header_search_paths(header_search_paths)
project.create_in(config.project_pods_root) project.create_in(config.project_pods_root)
end end
......
...@@ -72,6 +72,7 @@ module Pod ...@@ -72,6 +72,7 @@ module Pod
def add_header_search_paths(paths) def add_header_search_paths(paths)
objects_by_isa('XCBuildConfiguration').each do |uuid, object| objects_by_isa('XCBuildConfiguration').each do |uuid, object|
existing_paths = object['buildSettings']['HEADER_SEARCH_PATHS'] ||= [] existing_paths = object['buildSettings']['HEADER_SEARCH_PATHS'] ||= []
p paths
existing_paths.concat(paths) existing_paths.concat(paths)
end end
end end
......
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