From 3d8cbda2400d5fdc1df5b7284526641f0e0250a7 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Wed, 24 Feb 2016 18:48:06 -0500 Subject: [PATCH] version: fix tag parsing issues --- version.gradle | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/version.gradle b/version.gradle index 8b2b09074..f07c9d281 100644 --- a/version.gradle +++ b/version.gradle @@ -67,7 +67,7 @@ def getReleaseInfo(String tag) { } tag = tag.substring(1) - String[] parts = tag.split("-"); + String[] parts = tag.split("-", 2); String mainVersion; boolean prerelease; String releaseName = null; @@ -121,7 +121,13 @@ task configureVersionInfo { jmeGitHash = head.id jmeShortGitHash = head.abbreviatedId jmeBranchName = grgit.branch.current.name - jmeGitTag = grgit.tag.list().find { it.commit == head } ?: System.env.TRAVIS_TAG + jmeGitTag = grgit.tag.list().find { it.commit == head } + + if (jmeGitTag != null) { + jmeGitTag = jmeGitTag.name + } else { + jmeGitTag = System.env.TRAVIS_TAG + } def releaseInfo = getReleaseInfo(jmeGitTag) if (releaseInfo != null) {