aboutsummaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts7
1 files changed, 6 insertions, 1 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 8d144993c0..94850e1f59 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -36,6 +36,7 @@ buildscript {
plugins {
idea
java
+ id("org.ajoberstar.grgit") version("3.1.1")
}
apply(plugin = "forge")
@@ -151,7 +152,7 @@ tasks.withType<Jar> {
// this will ensure that this task is redone when the versions change.
this.inputs.properties += "version" to project.version
this.inputs.properties += "mcversion" to project.minecraft.version
- this.archiveBaseName.set("bartworks[${project.minecraft.version}]")
+ this.archiveBaseName.set("bartworks[${project.minecraft.version}]-[${getVersionAppendage()}]")
// replace stuff in mcmod.info, nothing else
this.filesMatching("/mcmod.info") {
@@ -203,4 +204,8 @@ artifacts {
this.archives(apiJar)
this.archives(sourcesJar)
this.archives(devJar)
+}
+
+fun getVersionAppendage() : String {
+ return org.ajoberstar.grgit.Grgit.open(mapOf("currentDir" to project.rootDir)).log().last().abbreviatedId
} \ No newline at end of file