Fix stop not working for DevServer starter

This commit is contained in:
2026-03-02 12:10:18 +01:00
parent 008ff1091f
commit a750185df0
+4 -2
View File
@@ -109,11 +109,11 @@ class DevServer extends DefaultTask {
Finalizer() { Finalizer() {
super() super()
doLast { doLast {
running = false
if (processInput != null) { if (processInput != null) {
processInput.write(template.endsWith("Velocity") ? "end\n" : "stop\n") processInput.write(template.endsWith("Velocity") ? "end\n" : "stop\n")
processInput.flush() processInput.flush()
} }
running = false
} }
} }
} }
@@ -245,10 +245,12 @@ class DevServer extends DefaultTask {
processInput.newLine() processInput.newLine()
processInput.flush() processInput.flush()
} }
processInput.close()
}).start() }).start()
process.waitFor() process.waitFor()
if (processInput != null) {
processInput.close()
}
processInput = null processInput = null
running = false running = false
} }