Fix version code issue

This commit is contained in:
Benoit Marty 2019-07-11 16:49:06 +02:00
parent ff80c3c8d5
commit 52dced43ff

View File

@ -12,9 +12,9 @@ androidExtensions {
experimental = true experimental = true
} }


def versionMajor = 0 ext.versionMajor = 0
def versionMinor = 1 ext.versionMinor = 1
def versionPatch = 0 ext.versionPatch = 0


static def getGitTimestamp() { static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct' def cmd = 'git show -s --format=%ct'
@ -63,7 +63,11 @@ android {
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 28 targetSdkVersion 28
multiDexEnabled true multiDexEnabled true
versionCode generateVersionCodeFromTimestamp()
// For release, use generateVersionCodeFromVersionName()
// versionCode generateVersionCodeFromTimestamp()
versionCode generateVersionCodeFromVersionName()

versionName "${versionMajor}.${versionMinor}.${versionPatch}" versionName "${versionMajor}.${versionMinor}.${versionPatch}"


buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\"" buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\""