import java.io.ByteArrayOutputStream plugins { id("java") id("com.github.johnrengelman.shadow") version "7.1.0" } group = "com.alttd" version = System.getenv("BUILD_NUMBER") ?: gitCommit() description = "Altitude AFK Detector plugin." apply() java { toolchain { languageVersion.set(JavaLanguageVersion.of(21)) } } tasks { withType { options.encoding = Charsets.UTF_8.name() } withType { options.encoding = Charsets.UTF_8.name() } jar { archiveFileName.set("${rootProject.name}.jar") } processResources { filteringCharset = Charsets.UTF_8.name() duplicatesStrategy = DuplicatesStrategy.INCLUDE filesMatching("plugin.yml") { expand(Pair("projectVersion", project.version)) } } } dependencies { compileOnly("com.alttd.cosmos:cosmos-api:1.21.6-R0.1-SNAPSHOT") { isChanging = true } compileOnly("de.keyle:mypet:3.11-SNAPSHOT") compileOnly("com.alttd:VillagerShopUI:1.1-SNAPSHOT") { isChanging = true } } fun gitCommit(): String { val os = ByteArrayOutputStream() project.exec { isIgnoreExitValue = true commandLine = "git rev-parse --short HEAD".split(" ") standardOutput = os } return String(os.toByteArray()).trim() }