From 66b5f2a046a51510d8a427b03759358ebc9a2fc0 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 13 Jan 2020 10:30:22 +0100 Subject: [PATCH] Do not append commits count and hash to release when on tag --- app/build.gradle | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 9c043d493..060edd246 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,7 +43,11 @@ task getGitVersion() { standardOutput = gitCommitHash } - gitVersion = gitVersionStream.toString().trim() + "." + gitCommitsCount.toString().trim() + "+" + gitCommitHash.toString().trim() + if (gitCommitsCount.toString().toInteger() == 0) { + gitVersion = gitVersionStream.toString().trim() + } else { + gitVersion = gitVersionStream.toString().trim() + "." + gitCommitsCount.toString().trim() + "+" + gitCommitHash.toString().trim() + } println("Git version: " + gitVersion) } catch (Exception e) { println("Git not found")