Commit 77d30006 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Allow checkout options to be used for :head pods

parent 9daf7749
...@@ -53,6 +53,8 @@ module Pod ...@@ -53,6 +53,8 @@ module Pod
@result.podfile_state = generate_podfile_state @result.podfile_state = generate_podfile_state
@locked_dependencies = generate_version_locking_dependencies @locked_dependencies = generate_version_locking_dependencies
store_existing_checkout_options
fetch_external_sources if allow_fetches fetch_external_sources if allow_fetches
@result.specs_by_target = resolve_dependencies @result.specs_by_target = resolve_dependencies
@result.specifications = generate_specifications @result.specifications = generate_specifications
...@@ -335,6 +337,14 @@ module Pod ...@@ -335,6 +337,14 @@ module Pod
end end
end end
def store_existing_checkout_options
podfile.dependencies.select { |d| d.external_source || d.head? }.each do |dep|
if checkout_options = lockfile && lockfile.checkout_options_for_pod_named(dep.root_name)
sandbox.store_checkout_source(dep.root_name, checkout_options)
end
end
end
# Converts the Podfile in a list of specifications grouped by target. # Converts the Podfile in a list of specifications grouped by target.
# #
# @note As some dependencies might have external sources the resolver # @note As some dependencies might have external sources the resolver
......
...@@ -81,7 +81,7 @@ module Pod ...@@ -81,7 +81,7 @@ module Pod
# #
def download_source def download_source
root.rmtree if root.exist? root.rmtree if root.exist?
if head_pod? if head_pod? && !sandbox.checkout_sources[root_spec.name]
begin begin
downloader.download_head downloader.download_head
@specific_source = downloader.checkout_options @specific_source = downloader.checkout_options
...@@ -148,7 +148,7 @@ module Pod ...@@ -148,7 +148,7 @@ module Pod
# source. # source.
# #
def downloader def downloader
@downloader ||= Downloader.for_target(root, root_spec.source.dup) @downloader ||= Downloader.for_target(root, sandbox.checkout_sources[root_spec.name] || root_spec.source.dup)
end end
#-----------------------------------------------------------------------# #-----------------------------------------------------------------------#
......
...@@ -302,7 +302,10 @@ module Pod ...@@ -302,7 +302,10 @@ module Pod
def find_cached_set(dependency) def find_cached_set(dependency)
name = dependency.root_name name = dependency.root_name
unless cached_sets[name] unless cached_sets[name]
if dependency.external_source if dependency.head?
spec = create_set_from_sources(dependency).specification
set = Specification::Set::Head.new(spec)
elsif dependency.external_source
spec = sandbox.specification(name) spec = sandbox.specification(name)
unless spec unless spec
raise StandardError, '[Bug] Unable to find the specification ' \ raise StandardError, '[Bug] Unable to find the specification ' \
...@@ -312,9 +315,7 @@ module Pod ...@@ -312,9 +315,7 @@ module Pod
else else
set = create_set_from_sources(dependency) set = create_set_from_sources(dependency)
end end
if dependency.head?
set = Specification::Set::Head.new(set.specification)
end
cached_sets[name] = set cached_sets[name] = set
unless set unless set
raise Molinillo::NoSuchDependencyError.new(dependency) # rubocop:disable Style/RaiseArgs raise Molinillo::NoSuchDependencyError.new(dependency) # rubocop:disable Style/RaiseArgs
......
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