Commit 2ca31f8f authored by Fabio Pelosin's avatar Fabio Pelosin

Load only required podspecs for external dependencies [see 15c4ca3]

parent 80809dc0
......@@ -15,8 +15,8 @@ module Pod
@specs = {}
result = @podfile.target_definitions.values.inject({}) do |result, target_definition|
puts "\n--> Finding dependencies for #{target_definition.name}" if Config.instance.verbose?
@loaded_specs = []
puts "\n--> Finding dependencies for #{target_definition.name}" if Config.instance.verbose?
@loaded_specs = []
find_dependency_sets(@podfile, target_definition.dependencies)
result[target_definition] = @specs.values_at(*@loaded_specs).sort_by(&:name)
result
......
......@@ -3,28 +3,28 @@ require 'fileutils'
module Pod
class Sandbox
attr_reader :root
HEADERS_DIR = "Headers"
def initialize(path)
@root = Pathname.new(path)
@header_search_paths = [HEADERS_DIR]
FileUtils.mkdir_p(@root)
end
def implode
root.rmtree
end
def headers_root
root + HEADERS_DIR
end
def project_path
root + "Pods.xcodeproj"
end
def add_header_file(namespace_path, relative_header_path)
namespaced_header_path = headers_root + namespace_path
namespaced_header_path.mkpath unless File.exist?(namespaced_header_path)
......@@ -33,27 +33,31 @@ module Pod
@header_search_paths << namespaced_header_path.relative_path_from(root)
namespaced_header_path + relative_header_path.basename
end
def add_header_files(namespace_path, relative_header_paths)
relative_header_paths.map { |path| add_header_file(namespace_path, path) }
end
def header_search_paths
@header_search_paths.uniq.map { |path| "$(PODS_ROOT)/#{path}" }
end
def prepare_for_install
headers_root.rmtree if headers_root.exist?
end
def installed_pods
Dir[root + "**/*.podspec"].map do |podspec|
LocalPod.from_podspec(Pathname.new(podspec), self)
def podspec_for_name(name)
if spec_path = Dir[root + "#{name}/*.podspec"].first
Pathname.new(spec_path)
elsif spec_path = Dir[root + "Local Podspecs/#{name}.podspec"].first
Pathname.new(spec_path)
end
end
def installed_pod_named(name)
installed_pods.find { |pod| pod.name == name }
if spec_path = podspec_for_name(name)
LocalPod.from_podspec(spec_path, self)
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