Class: Pod::DyInstaller::Xcode::PodsProjectGenerator::PodTargetIntegrator

Inherits:
Object
  • Object
show all
Defined in:
lib/pod/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) ⇒ PodTargetIntegrator

Init a new PodTargetIntegrator.

Parameters:

  • target (PodTarget)

    @see #target



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

def initialize(target)
  @target = target
end

Instance Attribute Details

#targetPodTarget (readonly)

Returns the target that should be integrated.

Returns:

  • (PodTarget)

    the target that should be integrated.



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

def target
  @target
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/pod/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/pod/installer/xcode/pods_project_generator/pod_target_integrator.rb', line 25

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