85 lines
No EOL
2.1 KiB
Kotlin
85 lines
No EOL
2.1 KiB
Kotlin
plugins {
|
|
java
|
|
`maven-publish`
|
|
|
|
alias(libs.plugins.run.paper)
|
|
}
|
|
|
|
group = "eu.m724"
|
|
version = "3.0.1"
|
|
|
|
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.")
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.processResources {
|
|
filesMatching("plugin.yml") {
|
|
expand("version" to version)
|
|
}
|
|
} |