mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 17:35:54 +03:00
Merge pull request #87 from Bubu/reproducible_versioncode
get timestamp for versioncode from last git commmit
This commit is contained in:
commit
d4b1f074e3
1 changed files with 6 additions and 1 deletions
|
@ -15,9 +15,14 @@ def versionMajor = 0
|
|||
def versionMinor = 1
|
||||
def versionPatch = 0
|
||||
|
||||
def getGitTimestamp() {
|
||||
def cmd = 'git show -s --format=%ct'
|
||||
return cmd.execute().text.trim() as Long
|
||||
}
|
||||
|
||||
static def generateVersionCodeFromTimestamp() {
|
||||
// It's unix timestamp divided by 10: It's incremented by one every 10 seconds.
|
||||
return (System.currentTimeMillis() / 1_000 / 10).toInteger()
|
||||
return (getGitTimestamp() / 10).toInteger()
|
||||
}
|
||||
|
||||
def generateVersionCodeFromVersionName() {
|
||||
|
|
Loading…
Reference in a new issue