Skip to content

Commit

Permalink
Added gradle task to quickly run ViaProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Oct 28, 2024
1 parent c422559 commit d653a5b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,30 @@ idea {
}
}

tasks.register("runViaProxy", JavaExec) {
dependsOn tasks.jar

def viaProxyConfiguration = configurations.create("viaProxy")
viaProxyConfiguration.dependencies.add(project.dependencies.create("net.raphimc:ViaProxy:3.3.4") {
transitive = false
})

mainClass = "net.raphimc.viaproxy.ViaProxy"
classpath viaProxyConfiguration

workingDir = file("run")

doFirst {
def jarsDir = new File(workingDir, "jars")
jarsDir.mkdirs()
new File(jarsDir, "${project.name}.jar").bytes = tasks.jar.archiveFile.get().asFile.bytes
}

doLast {
new File(workingDir, "jars/${project.name}.jar").delete()
}
}

String latestCommitHash() {
def stdout = new ByteArrayOutputStream()
exec {
Expand Down

0 comments on commit d653a5b

Please sign in to comment.