mirror of
https://github.com/ViaVersion/ViaAprilFools.git
synced 2024-11-15 10:35:12 +01:00
Add gradle task to quickly test/debug code changes
This commit is contained in:
parent
6fd7b8caab
commit
b1afee85c9
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@ hs_err_pid*
|
||||
.gradle/
|
||||
build/
|
||||
out/
|
||||
common/run/
|
@ -17,3 +17,29 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Task to quickly test/debug code changes using https://github.com/ViaVersion/ViaProxy
|
||||
// For further instructions see the ViaProxy repository README
|
||||
tasks.register("runViaProxy", JavaExec) {
|
||||
dependsOn tasks.jar
|
||||
|
||||
def viaProxyConfiguration = configurations.create("viaProxy")
|
||||
viaProxyConfiguration.dependencies.add(dependencies.create("net.raphimc:ViaProxy:3.3.5-SNAPSHOT") {
|
||||
transitive = false
|
||||
})
|
||||
|
||||
mainClass = "net.raphimc.viaproxy.ViaProxy"
|
||||
classpath = viaProxyConfiguration
|
||||
workingDir = file("run")
|
||||
|
||||
doFirst {
|
||||
def jarsDir = file("$workingDir/jars")
|
||||
jarsDir.mkdirs()
|
||||
file("$jarsDir/${project.name}.jar").bytes = tasks.jar.archiveFile.get().asFile.bytes
|
||||
}
|
||||
|
||||
doLast {
|
||||
file("$workingDir/jars/${project.name}.jar").delete()
|
||||
file("$workingDir/logs").deleteDir()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user