Giants/build.gradle.kts
m724 a4c60b0db3
Some checks failed
/ build (push) Has been cancelled
build(release): Tag 3.0.0
2026-01-12 16:49:07 +01:00

79 lines
2 KiB
Kotlin

plugins {
java
`maven-publish`
alias(libs.plugins.run.paper)
}
group = "eu.m724"
version = "3.0.0"
repositories {
mavenCentral()
maven {
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
}
dependencies {
compileOnly(libs.spigot.api)
compileOnly(libs.jackson.dataformat.yaml)
compileOnly(libs.mstats)
compileOnly(libs.jarupdater)
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks {
runServer {
minecraftVersion("1.21.11")
jvmArgs("-Dcom.mojang.eula.agree=true")
}
}
// TODO is this necessary?
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
// TODO what is this for?
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
}
tasks.test {
useJUnitPlatform()
}
tasks.named<Jar>("jar") {
doLast {
val keystorePath = project.findProperty("KEYSTORE_FILE") as? String
println(keystorePath)
if (keystorePath != null && file(keystorePath).exists()) {
println("Signing JAR: ${archiveFile.get()}")
ant.withGroovyBuilder {
"signjar"(
"jar" to archiveFile.get().asFile,
"keystore" to keystorePath,
"alias" to project.findProperty("KEY_ALIAS"),
"storepass" to project.findProperty("KEYSTORE_PASSWORD"),
"keypass" to project.findProperty("KEY_PASSWORD"),
"preservelastmodified" to "true",
"tsaurl" to "http://timestamp.digicert.com"
)
}
} else {
println("Keystore not found or properties missing. Skipping signing.")
}
}
}