ViaBackwards/common/build.gradle.kts

56 lines
1.5 KiB
Plaintext
Raw Normal View History

2021-02-18 14:34:33 +01:00
plugins {
id("net.kyori.blossom")
2023-09-06 03:30:10 +02:00
id("org.jetbrains.gradle.plugin.idea-ext")
2021-02-18 14:34:33 +01:00
}
2023-09-06 03:30:10 +02:00
sourceSets {
main {
blossom {
javaSources {
property("version", project.version.toString())
property("impl_version", "git-ViaBackwards-${project.version}:${rootProject.latestCommitHash()}")
}
}
}
2021-02-18 14:34:33 +01:00
}
dependencies {
compileOnlyApi(libs.viaver)
compileOnlyApi(libs.netty)
compileOnlyApi(libs.guava)
compileOnlyApi(libs.checkerQual)
2021-05-29 09:32:55 +02:00
}
java {
withJavadocJar()
}
// Task to quickly test/debug code changes using https://github.com/ViaVersion/ViaProxy
// For further instructions see the ViaProxy repository README
tasks.register<JavaExec>("runViaProxy") {
dependsOn(tasks.shadowJar)
val viaProxyConfiguration = configurations.create("viaProxy")
viaProxyConfiguration.dependencies.add(dependencies.create(rootProject.libs.viaProxy.get().copy().setTransitive(false)))
mainClass.set("net.raphimc.viaproxy.ViaProxy")
classpath = viaProxyConfiguration
workingDir = file("run")
2024-10-30 21:07:30 +01:00
jvmArgs = listOf("-DskipUpdateCheck")
if (System.getProperty("viaproxy.gui.autoStart") != null) {
jvmArgs("-Dviaproxy.gui.autoStart")
}
doFirst {
val jarsDir = file("$workingDir/jars")
jarsDir.mkdirs()
file("$jarsDir/${project.name}.jar").writeBytes(tasks.shadowJar.get().archiveFile.get().asFile.readBytes())
}
doLast {
file("$workingDir/jars/${project.name}.jar").delete()
file("$workingDir/logs").deleteRecursively()
}
}