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 dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0')
def versionCode = gitVersion() + (ext.configuration.buildDate.format("yyMM") + dayInYear + ext.todaysBuilds).toInteger()
println "version code " + versionCode
return versionCode.toInteger()
println "version code " + gitVersion()
return gitVersion().toInteger()
}
def versionNameFromGit() {
def dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0')
def versionName = gitVersion() + ext.configuration.buildDate.format('yyMM') + dayInYear + ext.todaysBuilds
println "version name " + versionName
return versionName
println "version name " + gitVersion()
return gitVersion()
}
apply plugin: 'com.android.application'

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