Implementata variabile build version in Gradle

This commit is contained in:
Giuseppe Scorrano 2019-01-09 17:51:42 +01:00
parent 34c3093094
commit fe528d69ab
2 changed files with 14 additions and 2 deletions

Binary file not shown.

View File

@ -15,6 +15,10 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
android {
def appVersionCode = 18
def appVersionName = '1.0.15'
signingConfigs {
release {
keyAlias 'wms key'
@ -29,8 +33,8 @@ android {
applicationId "it.integry.integrywmsnative"
minSdkVersion 21
targetSdkVersion 28
versionCode 18
versionName "1.0.15"
versionCode appVersionCode
versionName appVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.release
}
@ -50,6 +54,14 @@ android {
}
productFlavors {
}
build {
doLast {
delete "$projectDir/build/outputs/apk/release/version_v2.txt"
file("$projectDir/build/outputs/apk/release/version_v2.txt").text = appVersionCode + '\n' + appVersionName
}
}
}
dependencies {