Skip to content

Commit

Permalink
[ci skip] Add gradle task to quickly test/debug code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Oct 31, 2024
1 parent e0c05df commit 7b9888c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,33 @@ 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")
jvmArgs = ["-DskipUpdateCheck"]
if (System.getProperty("viaproxy.gui.autoStart") != null) {
jvmArgs("-Dviaproxy.gui.autoStart")
}

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

0 comments on commit 7b9888c

Please sign in to comment.