class Pod::DyInstaller::PostInstallHooksContext

Context object designed to be used with the HooksManager which describes the context of the installer.

Attributes

pods_project[RW]

@return [Project] The Pods Xcode project.

sandbox[RW]

@return [Sandbox] The Sandbox for the project.

sandbox_root[RW]

@return [String] The path to the sandbox root (`Pods` directory).

umbrella_targets[RW]

@return [Array<UmbrellaTargetDescription>] The list of

the CocoaPods umbrella targets generated by the installer.

Public Class Methods

generate(sandbox, aggregate_targets) click to toggle source

@return [PostInstallHooksContext] Convenience class generator method

@param [Sandbox] sandbox

The sandbox

@param [Array<AggregateTarget>] aggregate_targets

The aggregate targets, which will been presented by an adequate
{UmbrellaTargetDescription} in the generated context.

@return [HooksContext] Convenience class method to generate the

static context.
# File lib/pod/installer/post_install_hooks_context.rb, line 36
def self.generate(sandbox, aggregate_targets)
  umbrella_targets_descriptions = []
  aggregate_targets.each do |umbrella|
    desc = UmbrellaTargetDescription.new
    desc.user_project = umbrella.user_project
    desc.user_targets = umbrella.user_targets
    desc.specs = umbrella.specs
    desc.platform_name = umbrella.platform.name
    desc.platform_deployment_target = umbrella.platform.deployment_target.to_s
    desc.cocoapods_target_label = umbrella.label
    umbrella_targets_descriptions << desc
  end

  result = new
  result.sandbox_root = sandbox.root.to_s
  result.pods_project = sandbox.project
  result.sandbox = sandbox
  result.umbrella_targets = umbrella_targets_descriptions
  result
end