Merge remote-tracking branch 'origin/gradle' into gradle
Dieser Commit ist enthalten in:
Commit
c823f0f63d
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,7 +5,7 @@
|
||||
.gradle
|
||||
**/build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
gradle.properties
|
||||
steamwar.properties
|
||||
|
||||
# IntelliJ IDEA
|
||||
.idea
|
||||
|
26
build.gradle
26
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,20 +100,23 @@ task finalizeProject {
|
||||
}
|
||||
build.finalizedBy(finalizeProject)
|
||||
|
||||
if (project.hasProperty("hostname")) {
|
||||
def server = "Dev1.15"
|
||||
// def server = "Developer"
|
||||
if (steamwarProperties.containsKey("hostname")) {
|
||||
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)
|
||||
serverStart(server, serverStartFlags, hostname)
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,7 +125,7 @@ if (project.hasProperty("hostname")) {
|
||||
group "Steamwar"
|
||||
|
||||
doLast {
|
||||
serverStart(server)
|
||||
serverStart(server, serverStartFlags, hostname)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -135,8 +145,8 @@ private def shell(String command) {
|
||||
}
|
||||
}
|
||||
|
||||
private def serverStart(String serverName) {
|
||||
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");
|
||||
|
23
gradle.properties
Normale Datei
23
gradle.properties
Normale Datei
@ -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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
org.gradle.daemon = true
|
||||
org.gradle.parallel = true
|
||||
org.gradle.configureondemand = true
|
||||
org.gradle.workers.max = 4
|
In neuem Issue referenzieren
Einen Benutzer sperren