SteamWar/BauSystem
Archiviert
13
0

Update build.gradle for more flexible server start

Dieser Commit ist enthalten in:
yoyosource 2021-04-17 08:17:58 +02:00
Ursprung 7fc61812d6
Commit b815ac1ac0

Datei anzeigen

@ -101,20 +101,22 @@ task finalizeProject {
build.finalizedBy(finalizeProject)
if (steamwarProperties.containsKey("hostname")) {
def server = "Dev1.15"
def hostname = steamwarProperties.get("hostname")
// def server = "Developer"
String hostname = steamwarProperties.get("hostname")
String uploadPath = steamwarProperties.getOrDefault("uploadPath", "~")
String server = steamwarProperties.getOrDefault("server", "Dev1.15")
String serverStartFlags = steamwarProperties.getOrDefault("serverStartFlags", "")
task uploadProject {
description 'Upload this project'
group "Steamwar"
doLast {
await(shell("scp ${libs}/${jarName} ${hostname}:~/${server}/plugins"))
await(shell("scp ${libs}/${jarName} ${hostname}:${uploadPath}/${server}/plugins"))
if (!answer("Start ${server} server?")) {
return
}
serverStart(server, hostname)
serverStart(server, serverStartFlags, hostname)
}
}
@ -123,7 +125,7 @@ if (steamwarProperties.containsKey("hostname")) {
group "Steamwar"
doLast {
serverStart(server, hostname)
serverStart(server, serverStartFlags, hostname)
}
}
}
@ -143,8 +145,8 @@ private def shell(String command) {
}
}
private def serverStart(String serverName, String hostname) {
def proc = shell("ssh -t ${hostname} \"./mc ${serverName}\"")
private def serverStart(String serverName, String serverFlags, String hostname) {
def proc = shell("ssh -t ${hostname} \"./mc ${serverFlags} ${serverName}\"")
Set<String> strings = new HashSet<>()
File file = new File("${projectDir}/ignoredlog");