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) ⇒ PodTargetIntegrator

Initialize a new instance

Parameters:



17
18
19
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb', line 17

def initialize(target_installation_result)
  @target_installation_result = target_installation_result
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

Instance Method Details

#inspectString

Returns a string representation suitable for debugging.

Returns:

  • (String)

    a string representation suitable for debugging.



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

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

#integrate!void

This method returns an undefined value.

Integrates the pod target.



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb', line 25

def integrate!
  UI.section(integration_message) do
    target_installation_result.test_specs_by_native_target.each do |test_native_target, test_specs|
      add_embed_frameworks_script_phase(test_native_target)
      add_copy_resources_script_phase(test_native_target)
      UserProjectIntegrator::TargetIntegrator.create_or_update_user_script_phases(script_phases_for_specs(test_specs), test_native_target)
    end
    specs = target.non_test_specs
    UserProjectIntegrator::TargetIntegrator.create_or_update_user_script_phases(script_phases_for_specs(specs), target_installation_result.native_target)
  end
end