Commit 3bbee447 authored by Eloy Duran's avatar Eloy Duran

Generate BridgeSupport for each target.

parent 10befd83
...@@ -15,11 +15,9 @@ module Pod ...@@ -15,11 +15,9 @@ module Pod
@headers.map { |header| "-I '#{header.dirname}'" }.uniq @headers.map { |header| "-I '#{header.dirname}'" }.uniq
end end
def create_in(root) def save_as(pathname)
puts "==> Generating BridgeSupport metadata file" unless config.silent? puts "==> Generating BridgeSupport metadata file" unless config.silent?
file = root + "Pods.bridgesupport" gen_bridge_metadata %{-c "#{search_paths.join(' ')}" -o '#{pathname}' '#{headers.join("' '")}'}
gen_bridge_metadata %{-c "#{search_paths.join(' ')}" -o '#{file}' '#{headers.join("' '")}'}
file
end end
end end
end end
...@@ -15,6 +15,7 @@ module Pod ...@@ -15,6 +15,7 @@ module Pod
end end
class Target class Target
include Config::Mixin
include Shared include Shared
attr_reader :target attr_reader :target
...@@ -48,6 +49,18 @@ module Pod ...@@ -48,6 +49,18 @@ module Pod
"#{@definition.lib_name}-resources.sh" "#{@definition.lib_name}-resources.sh"
end end
def bridge_support_generator
BridgeSupportGenerator.new(build_specifications.map do |spec|
spec.header_files.map do |header|
config.project_pods_root + header
end
end.flatten)
end
def bridge_support_filename
"#{@definition.lib_name}.bridgesupport"
end
# TODO move xcconfig related code into the xcconfig method, like copy_resources_script and generate_bridge_support. # TODO move xcconfig related code into the xcconfig method, like copy_resources_script and generate_bridge_support.
def install! def install!
# First add the target to the project # First add the target to the project
...@@ -82,6 +95,10 @@ module Pod ...@@ -82,6 +95,10 @@ module Pod
def create_files_in(root) def create_files_in(root)
xcconfig.save_as(root + xcconfig_filename) xcconfig.save_as(root + xcconfig_filename)
if @podfile.generate_bridge_support?
bridge_support_generator.save_as(root + bridge_support_filename)
copy_resources_script.resources << bridge_support_filename
end
copy_resources_script.save_as(root + copy_resources_filename) copy_resources_script.save_as(root + copy_resources_filename)
end end
end end
...@@ -114,14 +131,6 @@ module Pod ...@@ -114,14 +131,6 @@ module Pod
@xcodeproj @xcodeproj
end end
def bridge_support_generator
BridgeSupportGenerator.new(build_specifications.map do |spec|
spec.header_files.map do |header|
config.project_pods_root + header
end
end.flatten)
end
def targets def targets
@targets ||= @podfile.targets.values.map do |target_definition| @targets ||= @podfile.targets.values.map do |target_definition|
Target.new(@podfile, xcodeproj, target_definition) Target.new(@podfile, xcodeproj, target_definition)
...@@ -136,14 +145,6 @@ module Pod ...@@ -136,14 +145,6 @@ module Pod
puts " * Copying contents of template directory `#{template.path}' to `#{root}'" if config.verbose? puts " * Copying contents of template directory `#{template.path}' to `#{root}'" if config.verbose?
template.copy_to(root) template.copy_to(root)
# This has to happen before we generate the individual targets to make the specs pass.
# TODO However, this will move into the Target installer class as well, because each
# target needs its own xcconfig and bridgesupport.
#if @podfile.generate_bridge_support?
#path = bridge_support_generator.create_in(root)
#copy_resources_script.resources << path.relative_path_from(config.project_pods_root)
#end
puts "==> Generating Xcode project and xcconfig" unless config.silent? puts "==> Generating Xcode project and xcconfig" unless config.silent?
targets.each do |target| targets.each do |target|
target.install! target.install!
......
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