From ac441ff80e98ff19b652268b935a1d2abd0033ec Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Sun, 10 Jul 2022 10:27:36 +0200 Subject: [PATCH] Automatic version name --- tracker/build.gradle | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tracker/build.gradle b/tracker/build.gradle index 76f87cdc..6c2c2432 100644 --- a/tracker/build.gradle +++ b/tracker/build.gradle @@ -1,11 +1,6 @@ apply plugin: 'com.android.library' apply plugin: 'maven-publish' -def versionMajor = 4 -def versionMinor = 1 -def versionPatch = 4 -def myVersionName = "${versionMajor}.${versionMinor}.${versionPatch}" - android { compileSdkVersion project.ext.globalCompileSdkVersion @@ -89,7 +84,7 @@ afterEvaluate { groupId = 'org.matomo.sdk' artifactId = 'tracker' - version = myVersionName + version = getTag() pom { name = 'Matomo SDK for Android' @@ -106,4 +101,10 @@ afterEvaluate { } } } -} \ No newline at end of file +} + +@SuppressWarnings('unused') +static def getTag() { + def process = "git describe --tags".execute() + return process.text.toString().trim() +}