AFKDetector/build.gradle.kts

60 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2023-12-25 13:35:44 +00:00
import java.io.ByteArrayOutputStream
2023-03-29 23:45:49 +00:00
plugins {
id("java")
id("com.github.johnrengelman.shadow") version "7.1.0"
}
group = "com.alttd"
2023-12-25 13:35:44 +00:00
version = System.getenv("BUILD_NUMBER") ?: gitCommit()
2023-03-29 23:45:49 +00:00
description = "Altitude AFK Detector plugin."
apply<JavaLibraryPlugin>()
java {
toolchain {
2025-06-28 00:47:49 +00:00
languageVersion.set(JavaLanguageVersion.of(21))
2023-03-29 23:45:49 +00:00
}
}
tasks {
withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
}
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
jar {
archiveFileName.set("${rootProject.name}.jar")
2023-03-29 23:45:49 +00:00
}
processResources {
filteringCharset = Charsets.UTF_8.name()
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filesMatching("plugin.yml") {
expand(Pair("projectVersion", project.version))
}
2023-03-29 23:45:49 +00:00
}
}
dependencies {
2025-06-28 00:47:49 +00:00
compileOnly("com.alttd.cosmos:cosmos-api:1.21.6-R0.1-SNAPSHOT") {
isChanging = true
}
2023-07-31 11:20:44 +00:00
compileOnly("de.keyle:mypet:3.11-SNAPSHOT")
2025-06-28 00:47:49 +00:00
compileOnly("com.alttd:VillagerShopUI:1.1-SNAPSHOT") {
isChanging = true
}
2023-12-25 13:35:44 +00:00
}
fun gitCommit(): String {
val os = ByteArrayOutputStream()
project.exec {
isIgnoreExitValue = true
commandLine = "git rev-parse --short HEAD".split(" ")
standardOutput = os
}
return String(os.toByteArray()).trim()
2025-06-28 00:47:49 +00:00
}