Class: Pod::Installer::Xcode::PodsProjectGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods/installer/xcode/pods_project_generator.rb,
lib/cocoapods/installer/xcode/pods_project_generator_result.rb,
lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb,
lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb,
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb,
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb,
lib/cocoapods/installer/xcode/pods_project_generator/target_installer_helper.rb,
lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb,
lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb,
lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb

Overview

The PodsProjectGenerator handles generation of CocoaPods Xcode projects.

Defined Under Namespace

Modules: TargetInstallerHelper Classes: AggregateTargetInstaller, AppHostInstaller, FileReferencesInstaller, InstallationResults, PodTargetInstaller, PodTargetIntegrator, PodsProjectGeneratorResult, TargetInstallationResult, TargetInstaller

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sandbox, aggregate_targets, pod_targets, build_configurations, installation_options, config, project_object_version, metadata_cache = nil) ⇒ PodsProjectGenerator

Initialize a new instance

Parameters:

  • sandbox (Sandbox)

    @see #sandbox

  • aggregate_targets (Array<AggregateTarget>)

    @see #aggregate_targets

  • pod_targets (Array<PodTarget>)

    @see #pod_targets

  • build_configurations (Hash{String => Symbol})

    @see #build_configurations

  • installation_options (InstallationOptions)

    @see #installation_options

  • config (Config)

    @see #config

  • project_object_version (Integer)

    @see #project_object_version

  • metadata_cache (ProjectMetadataCache) (defaults to: nil)

    @see #metadata_cache



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/cocoapods/installer/xcode/pods_project_generator.rb', line 65

def initialize(sandbox, aggregate_targets, pod_targets, build_configurations, installation_options, config,
               project_object_version,  = nil)
  @sandbox = sandbox
  @aggregate_targets = aggregate_targets
  @pod_targets = pod_targets
  @build_configurations = build_configurations
  @installation_options = installation_options
  @config = config
  @project_object_version = project_object_version
  @metadata_cache = 
end

Instance Attribute Details

#aggregate_targetsArray<AggregateTarget> (readonly)

Returns The model representations of an aggregation of pod targets generated for a target definition in the Podfile.

Returns:

  • (Array<AggregateTarget>)

    The model representations of an aggregation of pod targets generated for a target definition in the Podfile.



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

def aggregate_targets
  @aggregate_targets
end

#build_configurationsHash{String => Symbol} (readonly)

Returns The build configurations that need to be installed.

Returns:

  • (Hash{String => Symbol})

    The build configurations that need to be installed.



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

def build_configurations
  @build_configurations
end

#configConfig (readonly)

Returns the global CocoaPods configuration.

Returns:

  • (Config)

    the global CocoaPods configuration.



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

def config
  @config
end

#installation_optionsInstallationOptions (readonly)

Returns the installation options from the Podfile.

Returns:



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

def installation_options
  @installation_options
end

#metadata_cacheProjectMetadataCache (readonly)

Returns the metadata cache used to reconstruct target dependencies.

Returns:

  • (ProjectMetadataCache)

    the metadata cache used to reconstruct target dependencies.



52
53
54
# File 'lib/cocoapods/installer/xcode/pods_project_generator.rb', line 52

def 
  @metadata_cache
end

#pod_targetsArray<PodTarget> (readonly)

Returns The model representations of pod targets.

Returns:

  • (Array<PodTarget>)

    The model representations of pod targets.



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

def pod_targets
  @pod_targets
end

#project_object_versionInteger (readonly)

Returns the object version for the projects we will generate.

Returns:

  • (Integer)

    the object version for the projects we will generate.



48
49
50
# File 'lib/cocoapods/installer/xcode/pods_project_generator.rb', line 48

def project_object_version
  @project_object_version
end

#sandboxSandbox (readonly)

Returns The sandbox where the Pods should be installed.

Returns:

  • (Sandbox)

    The sandbox where the Pods should be installed.



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

def sandbox
  @sandbox
end

Instance Method Details

#configure_schemes(project, pod_targets, generator_result) ⇒ void

This method returns an undefined value.

Configure schemes for the specified project and pod targets. Schemes for development pods will be shared if requested by the integration.

Parameters:

  • project (PBXProject)

    The project to configure schemes for.

  • pod_targets (Array<PodTarget>)

    The pod targets within that project to configure their schemes.

  • generator_result (PodsProjectGeneratorResult)

    the result of the project generation



86
87
88
89
90
91
# File 'lib/cocoapods/installer/xcode/pods_project_generator.rb', line 86

def configure_schemes(project, pod_targets, generator_result)
  pod_targets.each do |pod_target|
    share_scheme = pod_target.should_build? && share_scheme_for_development_pod?(pod_target.pod_name) && sandbox.local?(pod_target.pod_name)
    configure_schemes_for_pod_target(project, pod_target, share_scheme, generator_result)
  end
end