mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-21 17:45:36 +01:00
Add gradle task to quickly test/debug code changes (#4211)
This commit is contained in:
parent
7985b39ed5
commit
a0c0b7eff2
5
.gitignore
vendored
5
.gitignore
vendored
@ -109,4 +109,7 @@ nb-configuration.xml
|
||||
.nb-gradle/
|
||||
|
||||
### MacOS ###
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
|
||||
### Run Folder ###
|
||||
common/run/
|
||||
|
@ -18,3 +18,26 @@ java {
|
||||
tasks.named<Jar>("sourcesJar") {
|
||||
from(project(":viaversion-api").sourceSets.main.get().allSource)
|
||||
}
|
||||
|
||||
// Task to quickly test/debug code changes using ViaProxy
|
||||
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")
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ checkerQual = "3.48.1"
|
||||
paper = "1.20.4-R0.1-SNAPSHOT"
|
||||
legacyBukkit = "1.8.8-R0.1-SNAPSHOT"
|
||||
velocity = "3.1.1"
|
||||
|
||||
viaProxy = "3.3.5-SNAPSHOT"
|
||||
|
||||
[libraries]
|
||||
|
||||
@ -40,6 +40,7 @@ checkerQual = { group = "org.checkerframework", name = "checker-qual", version.r
|
||||
paper = { group = "io.papermc.paper", name = "paper-api", version.ref = "paper" }
|
||||
legacyBukkit = { group = "org.bukkit", name = "bukkit", version.ref = "legacyBukkit" }
|
||||
velocity = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }
|
||||
viaProxy = { group = "net.raphimc", name = "ViaProxy", version.ref = "viaProxy" }
|
||||
|
||||
|
||||
[bundles]
|
||||
|
Loading…
Reference in New Issue
Block a user