Class: Pod::Installer::TargetInstaller

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

Overview

Controller class responsible of creating and configuring the static library target in Pods project. It also creates the support file needed by the target.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sandbox, library) ⇒ TargetInstaller

Returns a new instance of TargetInstaller.

Parameters:

  • project (Project)

    @see project

  • library (Library)

    @see library



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

def initialize(sandbox, library)
  @sandbox = sandbox
  @library = library
end

Instance Attribute Details

#libraryLibrary (readonly)

Returns The library whose target needs to be generated.

Returns:

  • (Library)

    The library whose target needs to be generated.



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

def library
  @library
end

#sandboxSandbox (readonly)

Returns sandbox the sandbox where the support files should be generated.

Returns:

  • (Sandbox)

    sandbox the sandbox where the support files should be generated.



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

def sandbox
  @sandbox
end

Instance Method Details

#install!void

This method returns an undefined value.

Creates the target in the Pods project and the relative support files.



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

def install!
  UI.message "- Installing target `#{library.name}` #{library.platform}" do
    add_target
    add_files_to_build_phases
    create_suport_files_group

    create_xcconfig_file
    create_target_environment_header
    create_prefix_header
    create_bridge_support_file
    create_copy_resources_script
    create_acknowledgements
    create_dummy_source
  end
end