mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Add generated versionCode from timestamp
This commit is contained in:
parent
0e491af8ab
commit
bfaab52b41
@ -11,6 +11,19 @@ androidExtensions {
|
|||||||
experimental = true
|
experimental = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def versionMajor = 0
|
||||||
|
def versionMinor = 1
|
||||||
|
def versionPatch = 0
|
||||||
|
|
||||||
|
def generateVersionCodeFromTimestamp() {
|
||||||
|
// It's unix timestamp divided by 10: It's incremented by one every 10 seconds.
|
||||||
|
return (System.currentTimeMillis() / 1_000 / 10).toInteger()
|
||||||
|
}
|
||||||
|
|
||||||
|
def generateVersionCodeFromVersionName() {
|
||||||
|
return versionMajor * 10000 + versionMinor * 100 + versionPatch
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
@ -18,8 +31,8 @@ android {
|
|||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
versionCode 1
|
versionCode generateVersionCodeFromTimestamp()
|
||||||
versionName "1.0"
|
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
Loading…
Reference in New Issue
Block a user