class Pod::Installer::Analyzer

Public Instance Methods

allDependenciesFor(name, localModules = LocalModuleManager.all_modules) click to toggle source
# File lib/cocoapods-localsource/PodSwizzle.rb, line 44
def allDependenciesFor(name, localModules = LocalModuleManager.all_modules)
  if LocalModuleManager.resolved?(name)
    # if the local dependency has already been resolved, we don't need to resolve the dependencies again.
    return []
  end

  pathComponents = name.split("/")
  baseName = pathComponents[0]
  importingSubspec = pathComponents.length > 1

  localModule = localModules[baseName]

  podspec = nil
  # Position in the modules directory to generate the subspecs correctly
  Dir.chdir(localModule.module_path) do
    podspec = eval File.read("#{baseName}.podspec")
  end

  # Use the subspec if we're importing it
  if importingSubspec
    podspec = podspec.subspec_by_name(name)
  end

  # Get all local dependencies of the spec/subspec
  allDependencies = podspec.all_dependencies.select { |d| LocalModuleManager.local?(d.name) }

  # Get other dependencies recursively
  allDependencies.each do |dependency|
    allDependencies += allDependenciesFor(dependency.name, localModules)
  end

  LocalModuleManager.set_resolved(name)
  return allDependencies.uniq
end
dependencies_to_fetch(podfile_state) click to toggle source
# File lib/cocoapods-localsource/PodSwizzle.rb, line 81
def dependencies_to_fetch(podfile_state)
  real_dependencies_to_fetch(podfile_state)

  resolvedLocalDependencies = @deps_to_fetch.map do |key, value|
    allDependenciesFor(key.name)
  end.flatten.uniq

  @deps_to_fetch = (@deps_to_fetch | resolvedLocalDependencies).uniq
end
Also aliased as: real_dependencies_to_fetch
real_dependencies_to_fetch(podfile_state)