Method: Lyp::DependencyResolver#resolve_tree

Defined in:
lib/lyp/resolver.rb

#resolve_treeObject

Resolve the given dependency tree and return a list of concrete packages that meet all dependency requirements.

The following stages are involved:

  • Create permutations of possible version combinations for all dependencies

  • Remove invalid permutations

  • Select the permutation with the highest versions



108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/lyp/resolver.rb', line 108

def resolve_tree
  permutations = permutate_simplified_tree
  permutations = filter_invalid_permutations(permutations)

  # select highest versioned dependencies (for those specified by user)
  user_deps = tree.dependencies.keys
  result = select_highest_versioned_permutation(permutations, user_deps).flatten

  if result.empty? && !tree.dependencies.empty?
    error("Failed to satisfy dependency requirements")
  else
    result
  end
end