Skip to content

Commit

Permalink
chore(gradle): adjust port for testGame
Browse files Browse the repository at this point in the history
  • Loading branch information
xeruf committed Jun 25, 2024
1 parent 31457d9 commit 79cc8a2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,14 @@ tasks {
testGameDir.mkdirs()
val java = "java"
//File("/usr/lib/jvm").listFiles { f:File -> f.name.contains("java-1") }?.max()?.resolve("bin/java").toString()
val port = "13054"
println("Running on Port: $port")
val server =
ProcessBuilder(
java,
"-Dlogback.configurationFile=${project(":server").projectDir.resolve("configuration/logback-trace.xml")}",
"-jar", (project(":server").getTasksByName("jar", false).single() as Jar).archiveFile.get().asFile.absolutePath
"-jar", (project(":server").getTasksByName("jar", false).single() as Jar).archiveFile.get().asFile.absolutePath,
"--port", port
)
.redirectOutput(testGameDir.resolve("server.log"))
.redirectError(testGameDir.resolve("server-err.log"))
Expand All @@ -141,8 +144,10 @@ tasks {
Thread.sleep(300)
val startClient: (Int) -> Process = {
Thread.sleep(300)
ProcessBuilder(java, "-jar", deployDir.resolve(deployedPlayer).absolutePath)
.redirectOutput(testGameDir.resolve("client$it.log")).redirectError(testGameDir.resolve("client$it-err.log")).start()
ProcessBuilder(
java, "-jar", deployDir.resolve(deployedPlayer).absolutePath,
"--port", port
).redirectOutput(testGameDir.resolve("client$it.log")).redirectError(testGameDir.resolve("client$it-err.log")).start()
}
startClient(1)
startClient(2)
Expand Down

0 comments on commit 79cc8a2

Please sign in to comment.