Skip to content

Commit

Permalink
Fix version code issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Jul 21, 2023
1 parent f431e76 commit 75aaa92
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion plugins/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,33 @@
import org.gradle.api.JavaVersion
import org.gradle.jvm.toolchain.JavaLanguageVersion

/**
* Version codes are quite sensitive, because there is a mix between bundle and APKs, and we have to take into
* account the future upgrade of Element Android.
* Max versionCode allowed by the PlayStore (for information):
* 2_100_000_000
* Current version code of EAx on the PlayStore, for the first uploaded beta (we cannot go below):
* ----1_001_000
* Current version code of EAx on the nightly:
* ----1_001_000
* Current version of Element Android (at some point EAx will replace this app) (v1.6.3)
* ----40_106_03a where a stands for the architecture: 1, 2, 3, 4 and 0 for the universal APK
* Current version of EAx distributed with Firebase app distribution:
* ----1_002_000
* Latest version of EAx distributed with Firebase app distribution (downgrading, so that's a problem)
* -------10_200
* Version when running the current debug build
* -------10_200
*
* So adding 4_000_000 to the current version Code computed here should be fine, we will have:
* Release version:
* ---40_001_020
* Nightly version:
* ---40_001_020
* Debug version:
* ---40_010_200
*/

// Note: 2 digits max for each value
private const val versionMajor = 0
private const val versionMinor = 1
Expand All @@ -27,7 +54,7 @@ private const val versionMinor = 1
private const val versionPatch = 2

object Versions {
val versionCode = (versionMajor * 1_00_00 + versionMinor * 1_00 + versionPatch) * 10
val versionCode = 4_000_000 + versionMajor * 1_00_00 + versionMinor * 1_00 + versionPatch
val versionName = "$versionMajor.$versionMinor.$versionPatch"
const val compileSdk = 33
const val targetSdk = 33
Expand Down

0 comments on commit 75aaa92

Please sign in to comment.