Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fastlane.Swift] Swift fastlane upgrader #18933 #19914

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions fastlane/lib/fastlane/swift_runner_upgrader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ def add_missing_flags!(dry_run: false)
# Check if upgrade is needed
# If fastlane build settings exists already, we don't need any more changes to the Xcode project
self.fastlane_runner_target.build_configurations.each { |config|
return false if dry_run && config.build_settings["CODE_SIGN_IDENTITY"].nil?
return false if dry_run && config.build_settings["MACOSX_DEPLOYMENT_TARGET"].nil?
return true if dry_run && config.build_settings["CODE_SIGN_IDENTITY"].nil?
return true if dry_run && config.build_settings["MACOSX_DEPLOYMENT_TARGET"].nil?
}
return true if dry_run
return false if dry_run

# Proceed to upgrade
self.fastlane_runner_target.build_configurations.each { |config|
Expand All @@ -236,11 +236,10 @@ 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
return true if dry_run && phase_copy_sign.nil?

return false if dry_run

# Proceed to upgrade
old_phase_copy_sign.remove_from_project unless old_phase_copy_sign.nil?
Expand Down