3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-25 15:50:10 +01:00

Add gradle task to quickly test/debug code changes (#4211)

Dieser Commit ist enthalten in:
RK_01 2024-10-29 14:00:55 +01:00 committet von GitHub
Ursprung 7985b39ed5
Commit a0c0b7eff2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
3 geänderte Dateien mit 29 neuen und 2 gelöschten Zeilen

5
.gitignore vendored
Datei anzeigen

@ -109,4 +109,7 @@ nb-configuration.xml
.nb-gradle/
### MacOS ###
.DS_Store
.DS_Store
### Run Folder ###
common/run/

Datei anzeigen

@ -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()
}
}

Datei anzeigen

@ -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]