using local json to control the current version

This commit is contained in:
Adam Brown 2022-03-07 19:04:25 +00:00
parent a40cb1d05f
commit 33e3ad3a4b
2 changed files with 10 additions and 2 deletions

View File

@ -10,8 +10,9 @@ android {
ndkVersion "25.0.8141415"
defaultConfig {
applicationId "app.dapk.st"
versionCode 2
versionName "0.0.1-alpha1"
def versionJson = new groovy.json.JsonSlurper().parseText(rootProject.file('version.json').text)
versionCode versionJson.code
versionName versionJson.name
resConfigs "en"
}
@ -23,6 +24,7 @@ android {
buildTypes {
debug {
versionNameSuffix =" [debug]"
matchingFallbacks = ['release']
signingConfig.storeFile rootProject.file("tools/debug.keystore")
}
@ -33,6 +35,8 @@ android {
'proguard/app.pro',
"proguard/serializationx.pro",
"proguard/olm.pro"
// actual releases are signed with a different config
signingConfig = buildTypes.debug.signingConfig
}
}

4
version.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "0.0.1-alpha01",
"code": 2
}