diff --git a/version.gradle b/version.gradle index 501132ac5..8b2b09074 100644 --- a/version.gradle +++ b/version.gradle @@ -116,13 +116,12 @@ def getReleaseInfo(String tag) { task configureVersionInfo { try { def grgit = Grgit.open(project.file('.')) - jmeRevision = grgit.log(includes:['HEAD']).size() - jmeGitHash = grgit.head().id - jmeShortGitHash = grgit.head().abbreviatedId + def head = grgit.head() + jmeRevision = grgit.log(includes: [head]).size() + jmeGitHash = head.id + jmeShortGitHash = head.abbreviatedId jmeBranchName = grgit.branch.current.name - //gtgit.describe doesn't behave like git describe and it doens't support any option - //jmeGitTag = grgit.describe() ?: System.env.TRAVIS_TAG - jmeGitTag = "git describe --tags --exact-match --dirty".execute().text.trim() ?: System.env.TRAVIS_TAG + jmeGitTag = grgit.tag.list().find { it.commit == head } ?: System.env.TRAVIS_TAG def releaseInfo = getReleaseInfo(jmeGitTag) if (releaseInfo != null) {