Skip to content

Commit

Permalink
Automatic version name
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesa2 committed Jul 10, 2022
1 parent 1e62b6f commit ac441ff
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tracker/build.gradle
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -89,7 +84,7 @@ afterEvaluate {

groupId = 'org.matomo.sdk'
artifactId = 'tracker'
version = myVersionName
version = getTag()

pom {
name = 'Matomo SDK for Android'
Expand All @@ -106,4 +101,10 @@ afterEvaluate {
}
}
}
}
}

@SuppressWarnings('unused')
static def getTag() {
def process = "git describe --tags".execute()
return process.text.toString().trim()
}

0 comments on commit ac441ff

Please sign in to comment.