From 45829d736a91d29d789bfb67244c5e49fe4d8348 Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Sun, 19 May 2024 14:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E7=89=88=E6=9C=AC=E5=8F=B7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=8F=90=E4=BA=A4hash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8f81d093d..3b3de5a8f 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,16 @@ plugins { id 'org.spongepowered.mixin' version '0.7.+' } -version = '0.0.8-SNAPSHOT' +def getGitCommitHash() { + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short', 'HEAD' + standardOutput = stdout + } + return stdout.toString().trim() +} + +version = '0.0.8-SNAPSHOT-' + getGitCommitHash() group = 'com.Atsushio.target' archivesBaseName = 'target'