Skip to content

CLI: configurable Android versionCode and iOS/macOS CFBundleVersion - #5735

Open
nicoburns wants to merge 1 commit into
mainfrom
devin/1785880821-version-code
Open

CLI: configurable Android versionCode and iOS/macOS CFBundleVersion#5735
nicoburns wants to merge 1 commit into
mainfrom
devin/1785880821-version-code

Conversation

@nicoburns

Copy link
Copy Markdown
Member

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 set CFBundleVersion (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:

  1. --version-code <u32> / DX_ANDROID_VERSION_CODE env var
  2. [android] version_code in Dioxus.toml
  3. derived from the crate version: major * 1_000_000 + minor * 1_000 + patch (errors if major > 2099 || minor > 999 || patch > 999; warns if a pre-release identifier is being dropped; 0.0.0 is bumped to 1)

The resolved value is validated against Play's 1..=2_100_000_000 range (BuildRequest::android_version_code() -> Result<u32>).

iOS/macOS CFBundleVersion — resolution order:

  1. --bundle-version <string> / DX_BUNDLE_VERSION env var
  2. [ios] bundle_version (new) or [macos] bundle_version (already existed in the config, now also honored by the dev-loop plist path) in Dioxus.toml
  3. crate version (previous behavior)

Wired through BuildRequest::apple_bundle_version() into ios.plist.hbs / mac.plist.hbs, and into the macOS bundler's plist generation (where the legacy [bundle.macos] bundle_version is kept as a fallback).

CFBundleShortVersionString and Android versionName still come from the crate version, unchanged.

Also enables clap's env feature for the CLI and regenerates schema.json.

Follow-up worth considering (not in this PR): Apple rejects non-n.n.n strings for CFBundleShortVersionString, so pre-release crate versions like 1.0.0-alpha should probably be stripped there.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/27c512c36bd94e0e97ea7ef938611aa5
Requested by: @nicoburns

@nicoburns nicoburns self-assigned this Aug 4, 2026
@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant