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

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

Overview

This class is responsible for integrating a pod target. This includes integrating the test targets included by each pod target.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_installation_result, use_input_output_paths: true) ⇒ PodTargetIntegrator

Initialize a new instance

Parameters:

  • target_installation_result (TargetInstallationResult)

    @see #target_installation_result

  • use_input_output_paths (Boolean) (defaults to: true)

    @see #use_input_output_paths



23
24
25
26
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb', line 23

def initialize(target_installation_result, use_input_output_paths: true)
  @target_installation_result = target_installation_result
  @use_input_output_paths = use_input_output_paths
end

Instance Attribute Details

#target_installation_resultTargetInstallationResult (readonly)

Returns the installation result of the target that should be integrated.

Returns:



11
12
13
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb', line 11

def target_installation_result
  @target_installation_result
end

#use_input_output_pathsBoolean (readonly) Also known as: use_input_output_paths?

Returns whether to use input/output paths for build phase scripts.

Returns:

  • (Boolean)

    whether to use input/output paths for build phase scripts



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

def use_input_output_paths
  @use_input_output_paths
end

Instance Method Details

#inspectString

Returns a string representation suitable for debugging.

Returns:

  • (String)

    a string representation suitable for debugging.



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

def inspect
  "#<#{self.class} for target `#{target.label}'>"
end

#integrate!void

This method returns an undefined value.

Integrates the pod target.



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

def integrate!
  UI.section(integration_message) do
    target_installation_result.non_library_specs_by_native_target.each do |native_target, spec|
      add_embed_frameworks_script_phase(native_target, spec)
      add_copy_resources_script_phase(native_target, spec)
      add_on_demand_resources(native_target, spec) if spec.app_specification?
      UserProjectIntegrator::TargetIntegrator.create_or_update_user_script_phases(script_phases_for_specs(spec), native_target)
    end
    add_copy_dsyms_script_phase(target_installation_result.native_target)
    add_copy_xcframeworks_script_phase(target_installation_result.native_target)
    UserProjectIntegrator::TargetIntegrator.create_or_update_user_script_phases(script_phases_for_specs(target.library_specs), target_installation_result.native_target)
  end
end