build: remove “git …”.execute() to retrieve git tag.

experimental
David Bernard 9 years ago
parent 8e866561b8
commit c0af575487
  1. 11
      version.gradle

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

Loading…
Cancel
Save