diff --git a/plugins/src/main/kotlin/Versions.kt b/plugins/src/main/kotlin/Versions.kt index fb1972c8fc..a14bc9d0cc 100644 --- a/plugins/src/main/kotlin/Versions.kt +++ b/plugins/src/main/kotlin/Versions.kt @@ -30,35 +30,24 @@ import org.gradle.jvm.toolchain.JavaLanguageVersion */ /** - * Year of the version on 2 digits. - * Do not update this value. it is updated by the release script. + * Blap versions the app in lockstep with the desktop release (upstream's CalVer scheme is + * gone). Bump these with every release; versionCode derives from them and must only grow + * within this scheme (max 2 digits for minor/patch). */ -private const val versionYear = 26 - -/** - * Month of the version on 2 digits. Value must be in [1,12]. - * Do not update this value. it is updated by the release script. - */ -private const val versionMonth = 7 - -/** - * Release number in the month. Value must be in [0,99]. - * Do not update this value. it is updated by the release script. - */ -private const val versionReleaseNumber = 3 +private const val versionMajor = 1 +private const val versionMinor = 0 +private const val versionPatch = 4 object Versions { /** * Base version code that will be set in the Android Manifest. * The value will be modified at build time to add the ABI code when APK are build. * AAB will have a ABI code of 0. - * See comment above for the calculation method. + * NOTE: this is a one-time DOWNGRADE from the upstream CalVer codes (2026xxxxx) — + * installs from before 1.0.4 must be uninstalled once; sideloads update in place after. */ - const val VERSION_CODE = (2000 + versionYear) * 10_000 + versionMonth * 100 + versionReleaseNumber - // Blap: the displayed version tracks the desktop release. VERSION_CODE stays on the - // CalVer formula above because Android requires it to only ever increase — keep - // bumping versionReleaseNumber (and month/year) for every release. - const val VERSION_NAME = "1.0.4" + const val VERSION_CODE = versionMajor * 10_000 + versionMinor * 100 + versionPatch + val VERSION_NAME = "$versionMajor.$versionMinor.$versionPatch" /** * Compile SDK version. Must be updated when a new Android version is released. @@ -104,8 +93,8 @@ object Versions { // Perform some checks on the values to avoid releasing with bad values init { - require(versionMonth in 1..12) { "versionMonth must be in [1,12]" } - require(versionReleaseNumber in 0..99) { "versionReleaseNumber must be in [0,99]" } + require(versionMinor in 0..99) { "versionMinor must be in [0,99]" } + require(versionPatch in 0..99) { "versionPatch must be in [0,99]" } require(BUILD_TOOLS_VERSION.startsWith(COMPILE_SDK.toString())) { "When updating COMPILE_SDK, please also update BUILD_TOOLS_VERSION" } } }