SteamWar/BauSystem
Archiviert
13
0

gradle #252

Manuell gemergt
SteamWar hat 35 Commits von gradle nach master 2021-05-22 21:04:38 +02:00 zusammengeführt
Nur Änderungen aus Commit 0ed8d26a66 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -98,11 +98,13 @@ if (project.hasProperty("hostname")) {
group "Steamwar"
doLast {
await(shell("scp ${libs}/${jarName} ${hostname}:~/Dev1.15/plugins"))
if (!answer("Start DEV server?")) {
def server = "Dev1.15"
// def server = "Developer"
await(shell("scp ${libs}/${jarName} ${hostname}:~/${server}/plugins"))
if (!answer("Start ${server} server?")) {
return
}
serverStart()
serverStart(server)
}
}
}
@ -113,12 +115,6 @@ def await(Process proc) {
proc.waitForProcessOutput(out, err)
}
/**
* Executes a shell command and returns the stdout result.
*
* @param command the command to execute (cannot contain pipes)
* @return the trimmed result from stdout, stderr and the exit value
*/
def shell(String command) {
def proc
if (operatingSystem == "unix") {
@ -129,11 +125,11 @@ def shell(String command) {
return proc
}
def serverStart() {
def proc = shell("ssh -t ${hostname} \"./mc Dev1.15\"")
def serverStart(String serverName) {
def proc = shell("ssh -t ${hostname} \"./mc ${serverName}\"")
Thread outputThread = proc.consumeProcessOutputStream(System.out)
outputThread.setName("OutputThread")
outputThread.setName("${serverName} - OutputThread")
Thread inputThread = new Thread(new Runnable() {
@Override
@ -151,7 +147,7 @@ def serverStart() {
}
}
})
inputThread.setName("InputThread")
inputThread.setName("${serverName} - InputThread")
inputThread.start()
while (proc.alive) {