[increment_version_number] update MARKETING_VERSION build setting#30031
Conversation
|
thanks! I wonder if we have an official existing action to do the replacement in xcodeproj, so we don't have to double up logic in this action that exists elsewhere. |
Good question. I checked the existing xcodeproj-related actions, but I couldn’t find a public action/helper that updates arbitrary build settings like MARKETING_VERSION directly. The closest actions are |
Yeah I think this needs a little cleanup and if you are up for it. I don't like how we are reaching into That to me probably should have been in Then saying that, a method in the root Does that make sense and are you up for it? |
Yep, that makes sense. I moved the Xcode project lookup into
I also added specs for the new helper methods and updated the increment_version_number specs. Validated locally with the focused specs and RuboCop. I also tested the |
There was a problem hiding this comment.
Pull request overview
This PR updates increment_version_number to sync version changes back into Xcode project build settings, addressing MARKETING_VERSION-based projects where agvtool does not update the build setting directly.
Changes:
- Adds shared Xcode project loading and build-setting update helpers.
- Updates
increment_version_numberto save MARKETING_VERSION afteragvtool. - Adds unit coverage for project loading and build-setting synchronization.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
fastlane/lib/fastlane/actions/increment_version_number.rb |
Syncs version build settings after running agvtool. |
fastlane/lib/fastlane/actions/get_version_number.rb |
Reuses shared Xcode project loading helper. |
fastlane/lib/fastlane/helper/xcodeproj_helper.rb |
Adds project loading and build-setting update helpers. |
fastlane/spec/actions_specs/increment_version_number_action_spec.rb |
Adds tests for MARKETING_VERSION sync behavior. |
fastlane/spec/helper/xcodeproj_helper_spec.rb |
Adds tests for new Xcode project helper methods. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed the Copilot review comments. The helper now handles build settings stored in a base The verbose message now preserves the original format returned by |
8639bad to
8ba61cf
Compare
8ba61cf to
5685309
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
fastlane/lib/fastlane/helper/xcodeproj_helper.rb:94
- Writing
.xcconfigfiles here creates a new kind of version-related modification, but the action never records these paths inActions.add_modified_files.commit_version_bumponly expects the pbxproj/Info.plist files plus paths fromMODIFIED_FILES, so lanes that run it after this action can now fail with the updated.xcconfigreported as an unexpected change.
File.write(path, new_content) if updated
5685309 to
ed82f18
Compare
|
Ah this is a bit larger now with the xcconfig stuff - let me read up |
There was a problem hiding this comment.
Hey @andredestro 👋
Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a month, and your PR will be included in the next one.
Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀"
There was a problem hiding this comment.
Congratulations! 🎉 This was released as part of fastlane 2.235.0 🚀
Checklist
bundle exec rspecfrom the root directory to see all new and existing tests passbundle exec rubocop -ato ensure the code style is validci/circlecibuilds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
PR #30011 fixed resolving
$(MARKETING_VERSION)when reading the current version, butagvtool new-marketing-versioncan still leave theMARKETING_VERSIONbuild setting unchanged in modern Xcode projects.Description
This syncs the new version back to the Xcode project's
MARKETING_VERSIONbuild setting after runningagvtool.The project is only saved when
MARKETING_VERSIONalready exists.Testing Steps
bundle exec rspec fastlane/spec/actions_specs/increment_version_number_action_spec.rbRUBOCOP_CACHE_ROOT=/private/tmp/rubocop_cache bundle exec rubocop fastlane/lib/fastlane/actions/increment_version_number.rb fastlane/spec/actions_specs/increment_version_number_action_spec.rb