From f7a37bfc815c34e88bcffab1a50b48ebc361ecfa 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 49b3d8e1d..82f3ae0fb 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")