fastlane/lib/fastlane/swift_runner_upgrader.rb
# adds new copy files build phase to fastlane_runner_target
adds new copy files build phase to fastlane_runner_target
adds new copy files build phase to fastlane_runner_target
def add_missing_copy_phase!(dry_run: false)
      phase_copy_sign = self.fastlane_runner_target.copy_files_build_phases.select { |phase_copy| phase_copy.name == "FastlaneRunnerCopySigned" }.first
      old_phase_copy_sign = self.fastlane_runner_target.shell_script_build_phases.select { |phase_copy| phase_copy.shell_script == "cd \"${SRCROOT}\"\ncd ../..\ncp \"${TARGET_BUILD_DIR}/${EXECUTABLE_PATH}\" .\n" }.first
      unless phase_copy_sign
        return false if dry_run
      end
      return true if dry_run
      old_phase_copy_sign.remove_from_project unless old_phase_copy_sign.nil?
      unless phase_copy_sign
        phase_copy_sign = self.fastlane_runner_target.new_copy_files_build_phase("FastlaneRunnerCopySigned")
        phase_copy_sign.dst_path = "$SRCROOT/../.."
        phase_copy_sign.dst_subfolder_spec = "0"
        phase_copy_sign.run_only_for_deployment_postprocessing = "0"
        targetBinaryReference = self.fastlane_runner_target.product_reference
        phase_copy_sign.add_file_reference(targetBinaryReference)
        targetBinaryReference.build_files.each { |target_binary_build_file_reference|
          target_binary_build_file_reference.settings = { "ATTRIBUTES": ["CodeSignOnCopy"] }
        }
      end
      target_project.save
    end
def add_missing_copy_phase! ( dry_run : false ) phase_copy_sign = self . fastlane_runner_target . copy_files_build_phases . select { | phase_copy | phase_copy . name == "FastlaneRunnerCopySigned" } . first old_phase_copy_sign = self . fastlane_runner_target . shell_script_build_phases . select { | phase_copy | phase_copy . shell_script == "cd \"${SRCROOT}\"\ncd ../..\ncp \"${TARGET_BUILD_DIR}/${EXECUTABLE_PATH}\" .\n" } . first unless phase_copy_sign return false if dry_run end return true if dry_run old_phase_copy_sign . remove_from_project unless old_phase_copy_sign . nil? unless phase_copy_sign phase_copy_sign = self . fastlane_runner_target . new_copy_files_build_phase ( "FastlaneRunnerCopySigned" ) phase_copy_sign . dst_path = "$SRCROOT/../.." phase_copy_sign . dst_subfolder_spec = "0" phase_copy_sign . run_only_for_deployment_postprocessing = "0" targetBinaryReference = self . fastlane_runner_target . product_reference phase_copy_sign . add_file_reference ( targetBinaryReference ) targetBinaryReference . build_files . each { | target_binary_build_file_reference | target_binary_build_file_reference . settings = { "ATTRIBUTES" : [ "CodeSignOnCopy" ] } } end target_project . save end
adds new copy files build phase to fastlane_runner_target
adds new copy files build phase to fastlane_runner_target
# Check if upgrade is needed # If fastlane copy files build phase exists already, we don't need any more changes to the Xcode project # Proceed to upgrade # Create a copy files build phase # Set "Code sign on copy" flag on Xcode for fastlane_runner_target
dry_run
<not_specific>