AFKDetector/build.gradle.kts

54 lines
1.2 KiB
Plaintext

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<JavaLibraryPlugin>()
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks {
withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
}
withType<Javadoc> {
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 {
implementation("com.alttd:Galaxy-API:1.20.4-R0.1-SNAPSHOT")
compileOnly("de.keyle:mypet:3.11-SNAPSHOT")
}
fun gitCommit(): String {
val os = ByteArrayOutputStream()
project.exec {
isIgnoreExitValue = true
commandLine = "git rev-parse --short HEAD".split(" ")
standardOutput = os
}
return String(os.toByteArray()).trim()
}