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 Method Summary collapse

Constructor Details

#initialize(sandbox, sandbox_root, pods_project, umbrella_targets) ⇒ PostInstallHooksContext

Initialize a new instance


31
32
33
34
35
36
# File 'lib/cocoapods/installer/post_install_hooks_context.rb', line 31

def initialize(sandbox, sandbox_root, pods_project, umbrella_targets)
  @sandbox = sandbox
  @sandbox_root = sandbox_root
  @pods_project = pods_project
  @umbrella_targets = umbrella_targets
end

Instance Attribute Details

#pods_projectXcodeproj::Project (readonly)


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

def pods_project
  @pods_project
end

#sandboxSandbox (readonly)


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

def sandbox
  @sandbox
end

#sandbox_rootString (readonly)


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

def sandbox_root
  @sandbox_root
end

#umbrella_targetsArray<UmbrellaTargetDescription> (readonly)


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, pods_project, aggregate_targets) ⇒ PostInstallHooksContext, HooksContext


53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/cocoapods/installer/post_install_hooks_context.rb', line 53

def self.generate(sandbox, pods_project, aggregate_targets)
  umbrella_targets_descriptions = aggregate_targets.map do |umbrella|
    user_project = umbrella.user_project
    user_targets = umbrella.user_targets
    specs = umbrella.specs
    platform_name = umbrella.platform.name
    platform_deployment_target = umbrella.platform.deployment_target.to_s
    cocoapods_target_label = umbrella.label
    UmbrellaTargetDescription.new(user_project, user_targets, specs, platform_name, platform_deployment_target, cocoapods_target_label)
  end

  new(sandbox, sandbox.root.to_s, pods_project, umbrella_targets_descriptions)
end