Do not append commits count and hash to release when on tag

This commit is contained in:
Sylvain Berfini 2020-01-13 10:30:22 +01:00
parent 076ceff33e
commit 66b5f2a046

View file

@ -43,7 +43,11 @@ task getGitVersion() {
standardOutput = gitCommitHash standardOutput = gitCommitHash
} }
if (gitCommitsCount.toString().toInteger() == 0) {
gitVersion = gitVersionStream.toString().trim()
} else {
gitVersion = gitVersionStream.toString().trim() + "." + gitCommitsCount.toString().trim() + "+" + gitCommitHash.toString().trim() gitVersion = gitVersionStream.toString().trim() + "." + gitCommitsCount.toString().trim() + "+" + gitCommitHash.toString().trim()
}
println("Git version: " + gitVersion) println("Git version: " + gitVersion)
} catch (Exception e) { } catch (Exception e) {
println("Git not found") println("Git not found")