use small hash for effective plugin version

This commit is contained in:
alexcrea 2025-06-14 13:47:20 +02:00
parent d4bb82dc87
commit 36a2bd23a6
No known key found for this signature in database
GPG key ID: 027DD67D2D3280C5

View file

@ -18,6 +18,9 @@ plugins {
group = "xyz.alexcrea" group = "xyz.alexcrea"
version = "1.11.3" version = "1.11.3"
val effectiveVersion = "$version" +
{(if(project.hasProperty("smallCommitHash")) "-${project.property("smallCommitHash")}" else "")}
repositories { repositories {
// EcoEnchants // EcoEnchants
maven(url = "https://repo.auxilor.io/repository/maven-public/") maven(url = "https://repo.auxilor.io/repository/maven-public/")
@ -135,7 +138,8 @@ val fatJar = tasks.register<Jar>("fatJar") {
manifest { manifest {
attributes.apply { put("Main-Class", "io.delilaheve.CustomAnvil") } attributes.apply { put("Main-Class", "io.delilaheve.CustomAnvil") }
} }
archiveFileName.set("${rootProject.name}-${project.version}.jar")
archiveFileName.set("${rootProject.name}-${effectiveVersion}.jar")
exclude("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA") exclude("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA")
duplicatesStrategy = DuplicatesStrategy.WARN duplicatesStrategy = DuplicatesStrategy.WARN
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
@ -158,7 +162,7 @@ tasks {
// Replace version and example fields in plugin.yml // Replace version and example fields in plugin.yml
filesMatching("plugin.yml") { filesMatching("plugin.yml") {
expand( expand(
"version" to project.version, "version" to effectiveVersion,
"libraries" to " \"org.jetbrains.kotlin:kotlin-stdlib:2.1.0\" " "libraries" to " \"org.jetbrains.kotlin:kotlin-stdlib:2.1.0\" "
) )
} }
@ -183,7 +187,7 @@ tasks {
filesMatching("plugin.yml") { filesMatching("plugin.yml") {
expand( expand(
"version" to "${project.version}-offline", "version" to "$effectiveVersion-offline",
"libraries" to "" "libraries" to ""
) )
} }