Module: Pod::Installer::Analyzer::LockingDependencyAnalyzer
- Defined in:
- lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb
Overview
Generates dependencies that require the specific version of the Pods that haven't changed in the Lockfile.
Class Method Summary collapse
- .add_child_vertex_to_graph(dependency_string, parents, dependency_graph, pods_to_unlock, added_dependency_strings) ⇒ Object private
- .add_to_dependency_graph(object, parents, dependency_graph, pods_to_unlock, added_dependency_strings) ⇒ Object private
-
.generate_version_locking_dependencies(lockfile, pods_to_update, pods_to_unlock = []) ⇒ Molinillo::DependencyGraph<Dependency>
Generates dependencies that require the specific version of the Pods that haven't changed in the Lockfile.
-
.unlocked_dependency_graph ⇒ Molinillo::DependencyGraph<Dependency>
Generates a completely 'unlocked' dependency graph.
Class Method Details
.add_child_vertex_to_graph(dependency_string, parents, dependency_graph, pods_to_unlock, added_dependency_strings) ⇒ Object (private)
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb', line 77 def self.add_child_vertex_to_graph(dependency_string, parents, dependency_graph, pods_to_unlock, added_dependency_strings) return unless added_dependency_strings.add?(dependency_string) dependency = Dependency.from_string(dependency_string) if pods_to_unlock.include?(dependency.root_name) dependency = Dependency.new(dependency.name) end vertex = dependency_graph.add_child_vertex(dependency.name, nil, parents, nil) dependency = vertex.payload.merge(dependency) if vertex.payload vertex.payload = dependency dependency end |
.add_to_dependency_graph(object, parents, dependency_graph, pods_to_unlock, added_dependency_strings) ⇒ Object (private)
89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb', line 89 def self.add_to_dependency_graph(object, parents, dependency_graph, pods_to_unlock, added_dependency_strings) case object when String add_child_vertex_to_graph(object, parents, dependency_graph, pods_to_unlock, added_dependency_strings) when Hash object.each do |key, value| dependency = add_child_vertex_to_graph(key, parents, dependency_graph, pods_to_unlock, added_dependency_strings) value.each { |v| add_to_dependency_graph(v, [dependency.name], dependency_graph, pods_to_unlock, added_dependency_strings) } end end end |
.generate_version_locking_dependencies(lockfile, pods_to_update, pods_to_unlock = []) ⇒ Molinillo::DependencyGraph<Dependency>
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb', line 32 def self.generate_version_locking_dependencies(lockfile, pods_to_update, pods_to_unlock = []) dependency_graph = Molinillo::DependencyGraph.new if lockfile added_dependency_strings = Set.new explicit_dependencies = lockfile.dependencies explicit_dependencies.each do |dependency| dependency_graph.add_vertex(dependency.name, dependency, true) end pods = lockfile.to_hash['PODS'] || [] pods.each do |pod| add_to_dependency_graph(pod, [], dependency_graph, pods_to_unlock, added_dependency_strings) end pods_to_update = pods_to_update.flat_map do |u| root_name = Specification.root_name(u).downcase dependency_graph.vertices.each_key.select { |n| Specification.root_name(n).downcase == root_name } end pods_to_update.each do |u| dependency_graph.detach_vertex_named(u) end dependency_graph.each do |vertex| next unless dep = vertex.payload dep.podspec_repo ||= lockfile.spec_repo(dep.root_name) end end dependency_graph end |
.unlocked_dependency_graph ⇒ Molinillo::DependencyGraph<Dependency>
Generates a completely 'unlocked' dependency graph.
71 72 73 |
# File 'lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb', line 71 def self.unlocked_dependency_graph Molinillo::DependencyGraph.new end |