Class: Pod::Installer::PostInstallHooksContext

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods/installer/post_install_hooks_context.rb

Overview

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

Defined Under Namespace

Classes: UmbrellaTargetDescription

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#sandbox_rootString

Returns The path to the sandbox root (‘Pods` directory).

Returns:

  • (String)

    The path to the sandbox root (‘Pods` directory).



9
10
11
# File 'lib/cocoapods/installer/post_install_hooks_context.rb', line 9

def sandbox_root
  @sandbox_root
end

#umbrella_targetsArray<UmbrellaTargetDescription>

Returns The list of the CocoaPods umbrella targets generated by the installer.

Returns:



14
15
16
# File 'lib/cocoapods/installer/post_install_hooks_context.rb', line 14

def umbrella_targets
  @umbrella_targets
end

Class Method Details

.generate(sandbox, aggregate_targets) ⇒ PostInstallHooksContext, HooksContext

Parameters:

Returns:

  • (PostInstallHooksContext)

    Convenience class generator method

  • (HooksContext)

    Convenience class method to generate the static context.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/cocoapods/installer/post_install_hooks_context.rb', line 28

def self.generate(sandbox, aggregate_targets)
  umbrella_targets_descriptions = []
  aggregate_targets.each do |umbrella|
    desc = UmbrellaTargetDescription.new
    desc.user_project_path = umbrella.user_project_path
    desc.user_target_uuids = umbrella.user_target_uuids
    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.umbrella_targets = umbrella_targets_descriptions
  result
end