Three-part version names for the car build

The unstable flavor appended upstream's CI build number as a fourth
part (2.8.0.0-unstable; always .0 without CI). Versions are now the
plain three-part defaultConfig version: 2.8.1-unstable, and build-car
names the APK NilsMG4-unstable-2.8.1.apk. The version code keeps the
x100000 factor (2.8.1 = 6700000): without it the code would fall below
the 6600000 already installed, and the installer refuses downgrades.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
2026-10-17 23:55:08 +02:00
co-authored by Claude Opus 5.5
parent 3f1e196817
commit 8bad5fc024
2 changed files with 15 additions and 16 deletions
+3
View File
@@ -114,6 +114,9 @@ tyre pressures, GPS (lat, lon, elevation, heading) and the is_* flags. It does *
INGEST_TOKEN) into git and pushed it. Commit amended and force-pushed; both values regenerated in
the now gitignored `k8s/secrets.yaml` (since moved to `k8s/secrets/secrets.yaml`, outside
`kubectl apply -f k8s/`). Filled-in secrets live only there from now on.
- 2026-10-17 — App 2.8.1: three-part version names (`2.8.1-unstable`, `NilsMG4-unstable-2.8.1.apk`).
Upstream's fourth part was its CI build number; the version code keeps the x100000 factor so it
never falls below codes already installed.
- 2026-10-17 — App 2.8.0: immersive full screen (switch in the Upload tab, default on). Hides the
system bars on the emulator; whether SAIC's own bars on the MG4 can be hidden is only known once
tried on the car.
+12 -16
View File
@@ -34,8 +34,8 @@ android {
applicationId "com.stinnesbeck.nilsmg4"
minSdk 27
targetSdk 36
versionCode 66
versionName "2.8.0"
versionCode 67
versionName "2.8.1"
// Nothing about the server ships in the APK: its URL and ingest token are entered in
// the app's Server tab (ServerConfig), and the database is only reachable by the server.
@@ -61,16 +61,13 @@ android {
unstable {
dimension "channel"
applicationIdSuffix ".unstable"
// Android uses versionCode, not versionName, to order package updates. Give
// every rolling CI build a strictly increasing code so Package Installer does
// not treat a newer unstable APK as the same package version.
versionCode defaultConfig.versionCode * 100000 +
(project.findProperty('unstableBuild') ?: '0').toString().toInteger()
// Le numéro de build fait partie du COEUR numérique de la version
// ("1.0.42-unstable"), pas du suffixe : l'updater compare des segments
// numériques, donc deux builds unstable doivent différer avant le premier tiret.
// -PunstableBuild=<n> est passé par la CI ; 0 en local.
versionName "${defaultConfig.versionName}.${project.findProperty('unstableBuild') ?: '0'}"
// Three-part versions, the same as defaultConfig ("2.8.1-unstable"). Upstream added
// a fourth part for its CI build number; there is no CI here and the OTA updater is
// off. The version code keeps upstream's x100000 so it never drops below codes
// already installed on the car (2.8.0.0 was 6600000): a lower code is a downgrade,
// which the installer refuses.
versionCode defaultConfig.versionCode * 100000
versionName defaultConfig.versionName
versionNameSuffix "-unstable"
buildConfigField "boolean", "OTA_ENABLED", "true"
}
@@ -106,12 +103,11 @@ android {
}
}
// Version publiée par la CI pour composer le nom de l'asset APK : ce nom DOIT être
// comparable par l'updater ("NilsMG4-unstable-1.0.42.apk"). Le tag de la
// pré-release est la constante "unstable", écrasée à chaque build.
// The version build-car puts in the APK's file name ("NilsMG4-unstable-2.8.1.apk"), which
// is also the name the OTA updater reads a release's version from.
tasks.register('printUnstableVersion') {
doLast {
println "${android.defaultConfig.versionName}.${project.findProperty('unstableBuild') ?: '0'}"
println android.defaultConfig.versionName
}
}