Increments version and build numbers as well
This commit is contained in:
parent
8d2ca4764d
commit
231cd69b5a
|
@ -136,8 +136,17 @@ android {
|
|||
def Properties versionProps = new Properties()
|
||||
|
||||
versionProps.load(new FileInputStream(versionPropsFile))
|
||||
def name = versionProps['VERSION_NAME']
|
||||
|
||||
// Increment the version
|
||||
def version = versionProps['VERSION_NAME']
|
||||
def build = versionProps['VERSION_BUILD'].toInteger() + 1
|
||||
def code = versionProps['VERSION_CODE'].toInteger() + 1
|
||||
def incstep = '0.0.1'.split(/\./).collect{it.toInteger()}
|
||||
def indexedVersionList = version.split(/\./).toList().withIndex()
|
||||
def updatedVersionList = indexedVersionList.collect{num, idx -> num.toInteger()+incstep[idx]}
|
||||
|
||||
versionProps['VERSION_NAME']=updatedVersionList.join(".")
|
||||
versionProps['VERSION_BUILD']=build.toString()
|
||||
versionProps['VERSION_CODE']=code.toString()
|
||||
versionProps.store(versionPropsFile.newWriter(), null)
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
|||
#Thu Sep 10 14:07:32 EDT 2020
|
||||
VERSION_NAME=1.0.1
|
||||
VERSION_BUILD=12
|
||||
VERSION_CODE=5
|
||||
#Thu Sep 10 15:14:20 EDT 2020
|
||||
VERSION_NAME=1.0.4
|
||||
VERSION_BUILD=13
|
||||
VERSION_CODE=8
|
||||
|
|
Loading…
Reference in New Issue