forked from GitHub-Mirror/riotX-android
get timestamp for versioncode from last git commmit
This makes the versioncode for an apk reproducible. Building the same commit/code will produce an apk with the same VC. Signed-off-by: Marcus Hoffmann <bubu@bubu1.eu>
This commit is contained in:
parent
99b1c0bed4
commit
97fa94592e
@ -15,9 +15,14 @@ def versionMajor = 0
|
|||||||
def versionMinor = 1
|
def versionMinor = 1
|
||||||
def versionPatch = 0
|
def versionPatch = 0
|
||||||
|
|
||||||
|
def getGitTimestamp() {
|
||||||
|
def cmd = 'git show -s --format=%ct'
|
||||||
|
return cmd.execute().text.trim() as Long
|
||||||
|
}
|
||||||
|
|
||||||
def generateVersionCodeFromTimestamp() {
|
def generateVersionCodeFromTimestamp() {
|
||||||
// It's unix timestamp divided by 10: It's incremented by one every 10 seconds.
|
// 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() {
|
def generateVersionCodeFromVersionName() {
|
||||||
|
Loading…
Reference in New Issue
Block a user