Skip to content

Commit 7fcc090

Browse files
committed
Document Versions.kt
1 parent c3db71b commit 7fcc090

File tree

1 file changed

+49
-4
lines changed

1 file changed

+49
-4
lines changed

plugins/src/main/kotlin/Versions.kt

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import org.gradle.jvm.toolchain.JavaLanguageVersion
1313
* Max versionCode allowed by the PlayStore (for information):
1414
* 2_100_000_000
1515
*
16-
* Also note that the versionCode is multiplied by 10 in app/build.gradle.kts#L168:
16+
* Also note that the versionCode is multiplied by 10 in app/build.gradle.kts:
1717
* ```
18-
* output.versionCode.set((output.versionCode.get() ?: 0) * 10 + abiCode))
18+
* output.versionCode.set((output.versionCode.orNull ?: 0) * 10 + abiCode)
1919
* ```
2020
* We are using a CalVer-like approach to version the application. The version code is calculated as follows:
2121
* - 2 digits for the year
@@ -28,28 +28,73 @@ import org.gradle.jvm.toolchain.JavaLanguageVersion
2828
* - the version code: 20250100a (202_501_00a) where `a` stands for the architecture code
2929
*/
3030

31+
/**
32+
* Year of the version on 2 digits.
33+
* Do not update this value. it is updated by the release script.
34+
*/
3135
private const val versionYear = 25
36+
37+
/**
38+
* Month of the version on 2 digits. Value must be in [1,12].
39+
* Do not update this value. it is updated by the release script.
40+
*/
3241
private const val versionMonth = 9
3342

34-
// Note: must be in [0,99]
43+
/**
44+
* Release number in the month. Value must be in [0,99].
45+
* Do not update this value. it is updated by the release script.
46+
*/
3547
private const val versionReleaseNumber = 1
3648

3749
object Versions {
50+
/**
51+
* Base version code that will be set in the Android Manifest.
52+
* The value will be modified at build time to add the ABI code when APK are build.
53+
* AAB will have a ABI code of 0.
54+
* See comment above for the calculation method.
55+
*/
3856
const val VERSION_CODE = (2000 + versionYear) * 10_000 + versionMonth * 100 + versionReleaseNumber
3957
val VERSION_NAME = "$versionYear.${versionMonth.toString().padStart(2, '0')}.$versionReleaseNumber"
4058

41-
// When updating COMPILE_SDK, please also update BUILD_TOOLS_VERSION
59+
/**
60+
* Compile SDK version. Must be updated when a new Android version is released.
61+
* When updating COMPILE_SDK, please also update BUILD_TOOLS_VERSION.
62+
*/
4263
const val COMPILE_SDK = 36
4364

65+
/**
66+
* Build tools version. Must be kept in sync with COMPILE_SDK.
67+
* The value is used by the release script.
68+
*/
4469
@Suppress("unused")
4570
private const val BUILD_TOOLS_VERSION = "36.0.0"
71+
72+
/**
73+
* Target SDK version. Should be kept up to date with COMPILE_SDK.
74+
*/
4675
const val TARGET_SDK = 36
4776

77+
/**
78+
* Minimum SDK version for FOSS builds.
79+
*/
4880
private const val MIN_SDK_FOSS = 24
81+
82+
/**
83+
* Minimum SDK version for Enterprise builds.
84+
*/
4985
private const val MIN_SDK_ENTERPRISE = 33
86+
87+
/**
88+
* minSdkVersion that will be set in the Android Manifest.
89+
*/
5090
val minSdk = if (isEnterpriseBuild) MIN_SDK_ENTERPRISE else MIN_SDK_FOSS
5191

92+
/**
93+
* Java version used for compilation.
94+
* Update this value when you want to use a newer Java version.
95+
*/
5296
private const val JAVA_VERSION = 21
97+
5398
val javaVersion: JavaVersion = JavaVersion.toVersion(JAVA_VERSION)
5499
val javaLanguageVersion: JavaLanguageVersion = JavaLanguageVersion.of(JAVA_VERSION)
55100

0 commit comments

Comments
 (0)