diff --git a/.gitignore b/.gitignore index 0949470..36e1257 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ .gradle **/build/ !gradle/wrapper/gradle-wrapper.jar -gradle.properties +steamwar.properties # IntelliJ IDEA .idea diff --git a/build.gradle b/build.gradle index 9bb750d..3a82648 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,8 @@ import org.apache.tools.ant.taskdefs.condition.Os +import java.util.function.BiConsumer + plugins { // Adding the base plugin fixes the following gradle warnings in IntelliJ: // @@ -37,6 +39,11 @@ plugins { group 'steamwar' version '' +Properties steamwarProperties = new Properties() +if (file("steamwar.properties").exists()) { + steamwarProperties.load(file("steamwar.properties").newDataInputStream()) +} + ext { buildName = 'BauSystem' artifactName = 'bausystem' @@ -93,8 +100,9 @@ task finalizeProject { } build.finalizedBy(finalizeProject) -if (project.hasProperty("hostname")) { +if (steamwarProperties.containsKey("hostname")) { def server = "Dev1.15" + def hostname = steamwarProperties.get("hostname") // def server = "Developer" task uploadProject { @@ -106,7 +114,7 @@ if (project.hasProperty("hostname")) { if (!answer("Start ${server} server?")) { return } - serverStart(server) + serverStart(server, hostname) } } @@ -115,7 +123,7 @@ if (project.hasProperty("hostname")) { group "Steamwar" doLast { - serverStart(server) + serverStart(server, hostname) } } } @@ -135,7 +143,7 @@ private def shell(String command) { } } -private def serverStart(String serverName) { +private def serverStart(String serverName, String hostname) { def proc = shell("ssh -t ${hostname} \"./mc ${serverName}\"") Set strings = new HashSet<>() diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..c5f12a3 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,23 @@ +# +# This file is a part of the SteamWar software. +# +# Copyright (C) 2020 SteamWar.de-Serverteam +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +org.gradle.daemon = true +org.gradle.parallel = true +org.gradle.configureondemand = true +org.gradle.workers.max = 4 \ No newline at end of file