import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { kotlin("jvm") id("com.gradleup.shadow") } base { archivesName.set("viaaxiom-velocity") } val targetJavaVersion = 21 repositories { mavenCentral() maven("https://repo.papermc.io/repository/maven-public/") maven("https://repo.viaversion.com/") } dependencies { implementation(project(":core")) implementation(kotlin("stdlib")) compileOnly("com.velocitypowered:velocity-api:3.4.0") compileOnly("com.viaversion:viaversion-api:5.12.2") // Velocity's API does not expose Netty; the proxy supplies it at runtime. compileOnly("io.netty:netty-all:4.2.19.Final") testImplementation(kotlin("test")) testImplementation("com.velocitypowered:velocity-api:3.4.0") testImplementation("io.netty:netty-all:4.2.19.Final") } tasks.processResources { inputs.property("version", project.version) filteringCharset = "UTF-8" filesMatching("velocity-plugin.json") { expand("version" to project.version) } } tasks.withType().configureEach { compilerOptions { jvmTarget.set(JvmTarget.fromTarget(targetJavaVersion.toString())) freeCompilerArgs.add("-Xjdk-release=$targetJavaVersion") } } tasks.withType().configureEach { options.release.set(targetJavaVersion) } tasks.test { useJUnitPlatform() } tasks.shadowJar { archiveClassifier.set("") // Zstd cannot be relocated, its JNI symbols are bound to the package name. relocate("kotlin", "me.wargearsystems.viaaxiom.shaded.kotlin") exclude("aix/**", "darwin/**", "freebsd/**", "win/x86/**", "win/aarch64/**") exclude("linux/arm/**", "linux/i386/**", "linux/loongarch64/**", "linux/mips64/**", "linux/ppc64/**", "linux/ppc64le/**", "linux/riscv64/**", "linux/s390x/**") from(rootProject.file("LICENSE.txt"), rootProject.file("NOTICE.txt")) } tasks.jar { archiveClassifier.set("thin") } tasks.assemble { dependsOn(tasks.shadowJar) }