gradle #252
22
build.gradle
22
build.gradle
@ -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) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren