Commit e2819ac3 authored by Luke Redpath's avatar Luke Redpath

TargetInstaller no longer needs access to #build_specifications

parent a751ba23
......@@ -2,29 +2,14 @@ module Pod
class Installer
autoload :TargetInstaller, 'cocoapods/installer/target_installer'
module Shared
def dependent_specifications
@dependent_specifications ||= Resolver.new(@podfile, @definition ? @definition.dependencies : nil).resolve
end
def build_specifications
dependent_specifications.reject do |spec|
spec.wrapper? || spec.defined_in_set.only_part_of_other_pod?
end
end
def download_only_specifications
dependent_specifications - build_specifications
end
end
include Config::Mixin
include Shared
attr_reader :sandbox
def initialize(podfile)
@podfile = podfile
# FIXME: pass this into the installer as a parameter
@sandbox = Sandbox.new(config.project_pods_root)
end
......@@ -189,5 +174,19 @@ module Pod
puts "[!] From now on use `#{File.basename(xcworkspace)}' instead of `#{File.basename(projpath)}'."
end
end
def dependent_specifications
@dependent_specifications ||= Resolver.new(@podfile, @definition ? @definition.dependencies : nil).resolve
end
def build_specifications
dependent_specifications.reject do |spec|
spec.wrapper? || spec.defined_in_set.only_part_of_other_pod?
end
end
def download_only_specifications
dependent_specifications - build_specifications
end
end
end
......@@ -2,7 +2,6 @@ module Pod
class Installer
class TargetInstaller
include Config::Mixin
include Shared
attr_reader :podfile, :project, :target_definition, :target
......@@ -34,11 +33,9 @@ module Pod
"#{@target_definition.lib_name}-resources.sh"
end
def bridge_support_generator
Generator::BridgeSupport.new(build_specifications.map do |spec|
spec.header_files.map do |header|
config.project_pods_root + header
end
def bridge_support_generator_for(pods, sandbox)
Generator::BridgeSupport.new(pods.map do |pod|
pod.header_files.map { |header| sandbox.root + header }
end.flatten)
end
......@@ -98,7 +95,7 @@ module Pod
if @podfile.generate_bridge_support?
bridge_support_metadata_path = sandbox.root + bridge_support_filename
puts "* Generating BridgeSupport metadata file at `#{bridge_support_metadata_path}'" if config.verbose?
bridge_support_generator.save_as(bridge_support_metadata_path)
bridge_support_generator_for(pods, sandbox).save_as(bridge_support_metadata_path)
copy_resources_script_for(pods).resources << bridge_support_filename
end
puts "* Generating xcconfig file at `#{sandbox.root + xcconfig_filename}'" if config.verbose?
......
......@@ -39,12 +39,13 @@ describe "Pod::Installer" do
config.rootspec = podfile
expected = []
installer = Pod::Installer.new(podfile)
installer.build_specifications.each do |spec|
pods = installer.build_specifications.map do |spec|
spec.header_files.each do |header|
expected << config.project_pods_root + header
end
Pod::LocalPod.new(spec, installer.sandbox)
end
installer.target_installers.first.bridge_support_generator.headers.should == expected
installer.target_installers.first.bridge_support_generator_for(pods, installer.sandbox).headers.should == expected
end
it "omits empty target definitions" do
......
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