Skip to content

Commit 3870a37

Browse files
committed
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.
1 parent 9f4a638 commit 3870a37

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

version.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,11 @@ task configureVersionInfo {
131131
jmeGitHash = head.id
132132
jmeShortGitHash = head.abbreviatedId
133133
jmeBranchName = grgit.branch.current.name
134-
jmeGitTag = grgit.tag.list().find { it.commit == head }
135134

136-
if (jmeGitTag != null) {
137-
jmeGitTag = jmeGitTag.name
138-
} else {
135+
if (System.env.TRAVIS_TAG != null) {
139136
jmeGitTag = System.env.TRAVIS_TAG
137+
} else {
138+
jmeGitTag = grgit.tag.list().find { it.commit == head }
140139
}
141140

142141
def releaseInfo = getReleaseInfo(jmeGitTag)

0 commit comments

Comments
 (0)