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

#pods_projectProject

Returns The Pods Xcode project.

Returns:

  • (Project)

    The Pods Xcode project.



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

def pods_project
  @pods_project
end

#sandboxSandbox

Returns The Sandbox for the project.

Returns:

  • (Sandbox)

    The Sandbox for the project.



17
18
19
# File 'lib/cocoapods/installer/post_install_hooks_context.rb', line 17

def sandbox
  @sandbox
end

#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:



22
23
24
# File 'lib/cocoapods/installer/post_install_hooks_context.rb', line 22

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.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/cocoapods/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