Skip to content

Commit

Permalink
[Fastlane.Swift] Swift fastlane upgrader fastlane#18933
Browse files Browse the repository at this point in the history
+ fix upgrades checks to avoid false not up-to-date messages.
  • Loading branch information
kikeenrique committed Feb 4, 2022
1 parent a5919ae commit f35fca5
Showing 1 changed file with 6 additions and 7 deletions.
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

0 comments on commit f35fca5

Please sign in to comment.