Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Actually commit resolver.rb

  • Loading branch information...
commit 30d8b91eb9e493e776d3bf1cce554f395f4c3ebe 1 parent 701db81
@alloy alloy authored
Showing with 30 additions and 0 deletions.
  1. +30 −0 lib/cocoa_pods/resolver.rb
View
30 lib/cocoa_pods/resolver.rb
@@ -0,0 +1,30 @@
+module Pod
+ class Resolver
+ def initialize(specification)
+ @specification = specification
+ end
+
+ def resolve
+ @sets = []
+ find_dependency_sets(@specification)
+ specs = @sets.map(&:podspec)
+ p specs
+ end
+
+ def find_dependency_sets(specification)
+ specification.read(:dependencies).each do |dependency|
+ Source.search(dependency).each do |set|
+ # TODO ultimately this compatibility check should be used to try and
+ # resolve the conflicts, but for now we'll keep it simple.
+ if existing_set = @sets.find { |s| s == set }
+ existing_set.required_by(specification, dependency)
+ else
+ set.required_by(specification, dependency)
+ @sets << set
+ find_dependency_sets(set.podspec)
+ end
+ end
+ end
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.