Class: Pod::SPM::Hook::UpdateEmbedFrameworksScript

Inherits:
Pod::SPM::Hook show all
Includes:
UpdateScript::Mixin
Defined in:
lib/cocoapods-spm/hooks/post_integrate/6.update_embed_frameworks_script.rb

Instance Method Summary collapse

Methods included from UpdateScript::Mixin

#update_script

Methods inherited from Pod::SPM::Hook

#aggregate_targets, #config, #initialize, #perform_settings_update, #pod_target_subprojects, #pod_targets, #podfile, #pods_project, #projects_to_integrate, run_hooks, #sandbox, #user_build_configurations

Methods included from Config::SPMConfigMixin

#local_macro_pod?, #local_macro_pod_dir, #macro_pods, #spm_config

Methods included from Config::PodConfigMixin

#pod_config

Methods included from Config::ProjectConfigMixin

#project_config

Constructor Details

This class inherits a constructor from Pod::SPM::Hook

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cocoapods-spm/hooks/post_integrate/6.update_embed_frameworks_script.rb', line 10

def run
  update_script(
    name: :embed_frameworks_script,
    content_by_target: lambda do |target|
      input_paths = framework_paths_for(target)
      output_paths = input_paths.map do |p|
        "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{File.basename(p)}"
      end
      lines = input_paths.map { |p| "install_framework \"#{p}\"" }
      [lines, input_paths, output_paths]
    end
  )
end