Skip to content

Commit

Permalink
Applies resolver patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Campbell committed Mar 11, 2016
1 parent 8f81936 commit d329e72
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/cocoapods-deploy/command/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 44,29 @@ def transform_podfile
transformer.transform_podfile(config.podfile)
end

# Applies patch to resolver as it needs help being pointed to use the
# local podspecs due to limitations in CocoaPods. We may be able to remove
# this in the future.
def apply_resolver_patch

Resolver.class_eval do
def find_cached_set(dependency)
name = dependency.root_name

unless cached_sets[name]
spec = sandbox.specification(name)
set = Specification::Set::External.new(spec)
cached_sets[name] = set
unless set
raise Molinillo::NoSuchDependencyError.new(dependency) # rubocop:disable Style/RaiseArgs
end
end

cached_sets[name]
end
end
end

# Installed required sources.
def install_sources_for_lockfile
config.lockfile.pod_names.each do |dep|
Expand All @@ -64,12 87,15 @@ def run
setup_environment
verify_environment

apply_resolver_patch

#TODO: Update this so we get the pods actually used in the lockfile.
# - Then we use this as a look up for the podfile.
# - We map the ones we match to the lockfile
# - We leave it to the resolver to notice there is something missing
# - When it does notice this we catch the error and replace it with something
# more informative
# - Somehow need to make sure platform ones are ignored.

#Install the sources from the lockfile
install_sources_for_lockfile
Expand Down
4 changes: 4 additions & 0 deletions lib/cocoapods-deploy/deploy_downloader.rb
Original file line number Diff line number Diff line change
@@ -0,0 1,4 @@
# This make sure we download all of the pods declared in the lockfile.
# - Once per pod spec
# - All even if they don't needed (needed for resolution)
# - Should respect checkout options

0 comments on commit d329e72

Please sign in to comment.