Browse Source

Fix Issue that version determination got confused when a commit had two tags.

This is only fixed when TRAVIS_TAG is present as an environment variable though, because otherwise it's unclear which tag has been used. Maybe there is a better solution to actually determine the current checked-out tag with grgit, but for local builds it probably doesn't matter enough either.
MeFisto94 6 years ago
parent
commit
3870a379c3
1 changed files with 3 additions and 4 deletions
  1. 3 4
      version.gradle

+ 3 - 4
version.gradle

@@ -131,12 +131,11 @@ task configureVersionInfo {
         jmeGitHash = head.id
         jmeShortGitHash = head.abbreviatedId
         jmeBranchName = grgit.branch.current.name
-        jmeGitTag = grgit.tag.list().find { it.commit == head }
         
-        if (jmeGitTag != null) {
-            jmeGitTag = jmeGitTag.name
-        } else {
+        if (System.env.TRAVIS_TAG != null) {
             jmeGitTag = System.env.TRAVIS_TAG
+        } else {
+            jmeGitTag = grgit.tag.list().find { it.commit == head }
         }
 
         def releaseInfo = getReleaseInfo(jmeGitTag)