Appconf Sets the App Version and Timestamp Build Number
-
Status: Approved (2026-09-22) by: @clsource
Problem
The visible app version and the build number are hardcoded (MARKETING_VERSION =
1.0, CURRENT_PROJECT_VERSION = 1, versionName = "4.0.0", versionCode = 1)
in the Xcode and Android projects and must be edited by hand. appconf should
set them from the merged config.jsonc via a new app_version key, computing
the build number as the current Unix timestamp so it grows automatically.
Decision
-
App version comes from
app_versionin the mergedconfig.jsonc, for example"1.0". It is optional: empty or missing leaves the versions untouched, so existing configs keep working. -
The build number is
time.Now().Unix()evaluated once perappconfrun (1.0.<timestamp>). It is monotonic in practice (a later run always gets a greater or equal number). -
Xcode: on the Application target only (anchored on
PRODUCT_BUNDLE_IDENTIFIER = <app_id>;, exactly 2 blocks = Debug + Release), setMARKETING_VERSIONtoapp_versionandCURRENT_PROJECT_VERSIONto the build number. Test and plugin targets are left untouched. -
Android:
versionNamebecomesapp_versionandversionCodethe build number inbuild.gradle.kts. Each line must appear exactly once. -
Both patches are idempotent and follow the existing strictness: unexpected marker counts fail rather than guess.
Changes
tools/appconf/src/main.go
-
Read
app_versionbesideapp_id/app_name. -
applyXcodeVersion: anchor on the Application bundle-id line (exactly 2 occurrences), rewriteCURRENT_PROJECT_VERSIONandMARKETING_VERSIONin those blocks (no-op whenapp_versionis empty). -
applyAndroidVersion:versionCodeandversionNamemust each appear exactly once; replace their values (no-op whenapp_versionis empty).