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


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)


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?


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


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

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
# 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)
      UserProjectIntegrator::TargetIntegrator.create_or_update_user_script_phases(script_phases_for_specs(spec), native_target)
    end
    UserProjectIntegrator::TargetIntegrator.create_or_update_user_script_phases(script_phases_for_specs(target.library_specs), target_installation_result.native_target)
  end
end