Class: Pod::Installer::Xcode::ProjectGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb

Overview

Responsible for creating and preparing a Pod::Project instance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sandbox, path, pod_targets, build_configurations, platforms, object_version, podfile_path = nil, pod_target_subproject: false) ⇒ ProjectGenerator

Initialize a new instance

Parameters:

  • sandbox (Sandbox)

    @see #sandbox

  • path (String)

    @see #path

  • pod_targets (Array<PodTarget>)

    @see #pod_targets

  • build_configurations (Hash{String=>Symbol})

    @see #build_configurations

  • platforms (Array<Platform>)

    @see #platforms

  • object_version (Integer)

    @see #object_version

  • podfile_path (String) (defaults to: nil)

    @see #podfile_path



56
57
58
59
60
61
62
63
64
65
66
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 56

def initialize(sandbox, path, pod_targets, build_configurations, platforms,
               object_version, podfile_path = nil, pod_target_subproject: false)
  @sandbox = sandbox
  @path = path
  @pod_targets = pod_targets
  @build_configurations = build_configurations
  @platforms = platforms
  @object_version = object_version
  @podfile_path = podfile_path
  @pod_target_subproject = pod_target_subproject
end

Instance Attribute Details

#build_configurationsHash{String=>Symbol} (readonly)

Returns A hash representing all the user build configurations across all integration targets. Each key corresponds to the name of a configuration and its value to its type (‘:debug` or `:release`).

Returns:

  • (Hash{String=>Symbol})

    A hash representing all the user build configurations across all integration targets. Each key corresponds to the name of a configuration and its value to its type (‘:debug` or `:release`).



27
28
29
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 27

def build_configurations
  @build_configurations
end

#object_versionInteger (readonly)

Returns Object version for the Xcode project.

Returns:

  • (Integer)

    Object version for the Xcode project.



35
36
37
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 35

def object_version
  @object_version
end

#pathString (readonly)

Returns path Path of the project.

Returns:

  • (String)

    path Path of the project.



15
16
17
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 15

def path
  @path
end

#platformsArray<Platform> (readonly)

Returns The list of all platforms this project supports.

Returns:

  • (Array<Platform>)

    The list of all platforms this project supports.



31
32
33
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 31

def platforms
  @platforms
end

#pod_target_subprojectBoolean (readonly)

Used by ‘generate_multiple_pod_projects` installation option.

Returns:

  • (Boolean)

    Bool indicating if this project is a pod target subproject.



44
45
46
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 44

def pod_target_subproject
  @pod_target_subproject
end

#pod_targetsArray<PodTarget> (readonly)

Returns pod_targets Array of pod targets this project includes.

Returns:

  • (Array<PodTarget>)

    pod_targets Array of pod targets this project includes.



20
21
22
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 20

def pod_targets
  @pod_targets
end

#podfile_pathString (readonly)

Returns Path to the Podfile included in the project.

Returns:

  • (String)

    Path to the Podfile included in the project.



39
40
41
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 39

def podfile_path
  @podfile_path
end

#sandboxSandbox (readonly)

Returns sandbox The Pods sandbox instance.

Returns:

  • (Sandbox)

    sandbox The Pods sandbox instance.



10
11
12
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 10

def sandbox
  @sandbox
end

Instance Method Details

#generate!Project

Returns Generated and prepared project.

Returns:

  • (Project)

    Generated and prepared project.



72
73
74
75
76
# File 'lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb', line 72

def generate!
  project = create_project(path, object_version, pod_target_subproject)
  prepare(sandbox, project, pod_targets, build_configurations, platforms, podfile_path)
  project
end