Module: Pod::PodGenerate::Patches::InstallerPatch::ParallelInstall

Defined in:
lib/cocoapods-podgenerate/patches/installer_patch.rb

Overview

── Optimization 3: Parallelize PodTargetIntegrator ──

Instance Method Summary collapse

Instance Method Details

#install_pod_targets(project, pod_targets) ⇒ Object



139
140
141
# File 'lib/cocoapods-podgenerate/patches/installer_patch.rb', line 139

def install_pod_targets(project, pod_targets)
  super
end

#integrate_targets(pod_target_installation_results) ⇒ Object



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/cocoapods-podgenerate/patches/installer_patch.rb', line 143

def integrate_targets(pod_target_installation_results)
  pods_to_integrate = pod_target_installation_results.values.select do |result|
    target = result.target
    !result.test_native_targets.empty? ||
      !result.app_native_targets.empty? ||
      target.contains_script_phases? ||
      target.framework_paths.values.flatten.any? { |p| !p.dsym_path.nil? } ||
      target.xcframeworks.values.any?(&:any?)
  end
  return if pods_to_integrate.empty?

  use_io_paths = !installation_options.disable_input_output_paths
  threads = pods_to_integrate.map do |result|
    Thread.new do
      begin
        Pod::Installer::Xcode::PodsProjectGenerator::PodTargetIntegrator.new(
          result, :use_input_output_paths => use_io_paths
        ).integrate!
      rescue StandardError => e
        Pod::UI.warn "[cocoapods-podgenerate] Integrate error: #{e.message}"
      end
    end
  end
  threads.each(&:join)
end