Class: Pod::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-user-defined-build-types/private_api_hooks.rb

Instance Method Summary collapse

Instance Method Details

#resolve_all_pod_build_types(pod_targets) ⇒ Object

Walk through pod dependencies and assign build_type from root through all transitive dependencies



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/cocoapods-user-defined-build-types/private_api_hooks.rb', line 61

def resolve_all_pod_build_types(pod_targets)
  root_pod_building_options = Pod::Podfile::TargetDefinition.root_pod_building_options.clone

  pod_targets.each do |target|
    next if not root_pod_building_options.key?(target.name)

    build_type = root_pod_building_options[target.name]
    dependencies = target.dependent_targets

    # Cascade build_type down
    while not dependencies.empty?
      new_dependencies = []
      dependencies.each do |dep_target|
        dep_target.user_defined_build_type = build_type
        new_dependencies.push(*dep_target.dependent_targets)
      end
      dependencies = new_dependencies
    end

    target.user_defined_build_type = build_type
  end
end