CLI: configurable Android versionCode and iOS/macOS CFBundleVersion - #5735
Open
nicoburns wants to merge 1 commit into
Open
CLI: configurable Android versionCode and iOS/macOS CFBundleVersion#5735nicoburns wants to merge 1 commit into
nicoburns wants to merge 1 commit into
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supersedes/extends #5525. The generated Android Gradle project pins
versionCode = 1, which makes Play Store uploads impossible after the first one, and iOS/macOS have no way to setCFBundleVersion(the App Store build number) independently of the crate version. This adds explicit config + per-build overrides, with a semver-derived fallback (matching Tauri v2's default behavior):Android
versionCode— resolution order:--version-code <u32>/DX_ANDROID_VERSION_CODEenv var[android] version_codein Dioxus.tomlmajor * 1_000_000 + minor * 1_000 + patch(errors ifmajor > 2099 || minor > 999 || patch > 999; warns if a pre-release identifier is being dropped;0.0.0is bumped to 1)The resolved value is validated against Play's
1..=2_100_000_000range (BuildRequest::android_version_code() -> Result<u32>).iOS/macOS
CFBundleVersion— resolution order:--bundle-version <string>/DX_BUNDLE_VERSIONenv var[ios] bundle_version(new) or[macos] bundle_version(already existed in the config, now also honored by the dev-loop plist path) in Dioxus.tomlWired through
BuildRequest::apple_bundle_version()intoios.plist.hbs/mac.plist.hbs, and into the macOS bundler's plist generation (where the legacy[bundle.macos] bundle_versionis kept as a fallback).CFBundleShortVersionStringand AndroidversionNamestill come from the crate version, unchanged.Also enables clap's
envfeature for the CLI and regeneratesschema.json.Follow-up worth considering (not in this PR): Apple rejects non-
n.n.nstrings forCFBundleShortVersionString, so pre-release crate versions like1.0.0-alphashould probably be stripped there.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/27c512c36bd94e0e97ea7ef938611aa5
Requested by: @nicoburns