From c0af575487273296ef935b2d7cf670f503bdaa8a Mon Sep 17 00:00:00 2001 From: David Bernard Date: Wed, 24 Feb 2016 22:46:47 +0100 Subject: [PATCH] =?UTF-8?q?build:=20remove=20=E2=80=9Cgit=20=E2=80=A6?= =?UTF-8?q?=E2=80=9D.execute()=20to=20retrieve=20git=20tag.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- version.gradle | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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) {