Commit a4feabfd authored by Fabio Pelosin's avatar Fabio Pelosin

[Installer] Cache locally sourced pods.

The caching of LocalPods might need a refactor.

Closes #485
parent e2d59610
...@@ -190,7 +190,7 @@ module Pod ...@@ -190,7 +190,7 @@ module Pod
@pods_by_spec[target_definition.platform] = {} @pods_by_spec[target_definition.platform] = {}
result[target_definition] = specs.map do |spec| result[target_definition] = specs.map do |spec|
if spec.local? if spec.local?
LocalPod::LocalSourcedPod.new(spec, sandbox, target_definition.platform) @sandbox.locally_sourced_pod_for_spec(spec, target_definition.platform)
else else
@sandbox.local_pod_for_spec(spec, target_definition.platform) @sandbox.local_pod_for_spec(spec, target_definition.platform)
end end
......
...@@ -14,6 +14,7 @@ module Pod ...@@ -14,6 +14,7 @@ module Pod
@build_headers = HeadersDirectory.new(self, BUILD_HEADERS_DIR) @build_headers = HeadersDirectory.new(self, BUILD_HEADERS_DIR)
@public_headers = HeadersDirectory.new(self, PUBLIC_HEADERS_DIR) @public_headers = HeadersDirectory.new(self, PUBLIC_HEADERS_DIR)
@cached_local_pods = {} @cached_local_pods = {}
@cached_locally_sourced_pods = {}
FileUtils.mkdir_p(@root) FileUtils.mkdir_p(@root)
end end
...@@ -37,6 +38,15 @@ module Pod ...@@ -37,6 +38,15 @@ module Pod
end end
end end
# TODO: refactor the pods from a local source should not be chached by the sandbox
#
def locally_sourced_pod_for_spec(spec, platform)
key = [spec.top_level_parent.name, platform.to_sym]
(@cached_locally_sourced_pods[key] ||= LocalPod::LocalSourcedPod.new(spec.top_level_parent, self, platform)).tap do |pod|
pod.add_specification(spec)
end
end
def installed_pod_named(name, platform) def installed_pod_named(name, platform)
if spec_path = podspec_for_name(name) if spec_path = podspec_for_name(name)
key = [name, platform.to_sym] key = [name, platform.to_sym]
......
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