From 6279cd01beb62da3c04333e2eb1c7f86a973a9d6 Mon Sep 17 00:00:00 2001 From: Len <40720638+destro174@users.noreply.github.com> Date: Wed, 3 Jan 2024 15:47:51 +0100 Subject: [PATCH] Auto increment version in plugin.yml --- build.gradle.kts | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8bd57c6..3913f49 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,10 @@ -import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation - plugins { id("java") - id("com.github.johnrengelman.shadow") version "7.1.0" id("maven-publish") } group = "com.alttd" -version = "1.0-SNAPSHOT" +version = System.getenv("BUILD_NUMBER") ?: "1.0-SNAPSHOT" description = "Altitude's Transfer Items plugin" apply() @@ -27,20 +24,16 @@ tasks { options.encoding = Charsets.UTF_8.name() } - shadowJar { - dependsOn(getByName("relocateJars") as ConfigureShadowRelocation) - archiveFileName.set("${project.name}-${project.version}.jar") - minimize() - configurations = listOf(project.configurations.shadow.get()) + jar { + archiveFileName.set("${rootProject.name}.jar") } - build { - dependsOn(shadowJar) - } - - create("relocateJars") { - target = shadowJar.get() - prefix = "${project.name}.lib" + processResources { + filteringCharset = Charsets.UTF_8.name() + duplicatesStrategy = DuplicatesStrategy.INCLUDE + filesMatching("plugin.yml") { + expand(Pair("version", project.version)) + } } }