New (new, new, new, new) way for handling versions. Will work with jenkins and fdroid.

This commit is contained in:
Amine Bou 2018-05-24 22:32:34 +02:00
parent 2799a48f2b
commit 38b5e7dc65
2 changed files with 19 additions and 9 deletions

View File

@ -15,17 +15,13 @@ def gitVersion() {
} }
def versionCodeFromGit() { def versionCodeFromGit() {
def dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0') println "version code " + gitVersion()
def versionCode = gitVersion() + (ext.configuration.buildDate.format("yyMM") + dayInYear + ext.todaysBuilds).toInteger() return gitVersion().toInteger()
println "version code " + versionCode
return versionCode.toInteger()
} }
def versionNameFromGit() { def versionNameFromGit() {
def dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0') println "version name " + gitVersion()
def versionName = gitVersion() + ext.configuration.buildDate.format('yyMM') + dayInYear + ext.todaysBuilds return gitVersion()
println "version name " + versionName
return versionName
} }
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
@ -176,4 +172,4 @@ def initAppLoginPropertiesIfNeeded() {
entry(key: "appLoginPassword", value: System.getProperty("appLoginPassword")) entry(key: "appLoginPassword", value: System.getProperty("appLoginPassword"))
} }
} }
} }

14
version.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
BASE_VERSION="v1.6"
TODAYS_VERSION="1"
VERSION="${BASE_VERSION}.$(date '+%y%m%j')$TODAYS_VERSION"
echo "Creating tag $VERSION"
git tag $VERSION
echo "Pushing tag"
git push origin $VERSION