Skip to content

Commit

Permalink
Version code based on time millis:
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed Nov 8, 2024
1 parent 16337ed commit ed424dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ plugins {
androidGitVersion {
prefix = "v"
codeFormat = "MNPBB"
baseCode = 3030000
}

thanoxVersionCode = androidGitVersion.code()
// Make sure new code > released.
val legacyCodeBase = 2000000
// 2000.1.1 millis
val startOf2000 = 946684800000L
// +1 10min
val versionCodeByTime =
((System.currentTimeMillis() - startOf2000) / 1000 / 60 / 10).toInt() + legacyCodeBase
thanoxVersionCode = versionCodeByTime
thanoxVersionName = androidGitVersion.name()

printVersions()
Expand Down

0 comments on commit ed424dc

Please sign in to comment.