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
|
.gradle
|
||||||
**/build/
|
**/build/
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
gradle.properties
|
steamwar.properties
|
||||||
|
|
||||||
# IntelliJ IDEA
|
# IntelliJ IDEA
|
||||||
.idea
|
.idea
|
||||||
|
26
build.gradle
26
build.gradle
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
import org.apache.tools.ant.taskdefs.condition.Os
|
import org.apache.tools.ant.taskdefs.condition.Os
|
||||||
|
|
||||||
|
import java.util.function.BiConsumer
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
// Adding the base plugin fixes the following gradle warnings in IntelliJ:
|
// Adding the base plugin fixes the following gradle warnings in IntelliJ:
|
||||||
//
|
//
|
||||||
@ -37,6 +39,11 @@ plugins {
|
|||||||
group 'steamwar'
|
group 'steamwar'
|
||||||
version ''
|
version ''
|
||||||
|
|
||||||
|
Properties steamwarProperties = new Properties()
|
||||||
|
if (file("steamwar.properties").exists()) {
|
||||||
|
steamwarProperties.load(file("steamwar.properties").newDataInputStream())
|
||||||
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
buildName = 'BauSystem'
|
buildName = 'BauSystem'
|
||||||
artifactName = 'bausystem'
|
artifactName = 'bausystem'
|
||||||
@ -93,20 +100,23 @@ task finalizeProject {
|
|||||||
}
|
}
|
||||||
build.finalizedBy(finalizeProject)
|
build.finalizedBy(finalizeProject)
|
||||||
|
|
||||||
if (project.hasProperty("hostname")) {
|
if (steamwarProperties.containsKey("hostname")) {
|
||||||
def server = "Dev1.15"
|
String hostname = steamwarProperties.get("hostname")
|
||||||
// def server = "Developer"
|
String uploadPath = steamwarProperties.getOrDefault("uploadPath", "~")
|
||||||
|
|
||||||
|
String server = steamwarProperties.getOrDefault("server", "Dev1.15")
|
||||||
|
String serverStartFlags = steamwarProperties.getOrDefault("serverStartFlags", "")
|
||||||
|
|
||||||
task uploadProject {
|
task uploadProject {
|
||||||
description 'Upload this project'
|
description 'Upload this project'
|
||||||
group "Steamwar"
|
group "Steamwar"
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
await(shell("scp ${libs}/${jarName} ${hostname}:~/${server}/plugins"))
|
await(shell("scp ${libs}/${jarName} ${hostname}:${uploadPath}/${server}/plugins"))
|
||||||
if (!answer("Start ${server} server?")) {
|
if (!answer("Start ${server} server?")) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
serverStart(server)
|
serverStart(server, serverStartFlags, hostname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +125,7 @@ if (project.hasProperty("hostname")) {
|
|||||||
group "Steamwar"
|
group "Steamwar"
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
serverStart(server)
|
serverStart(server, serverStartFlags, hostname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -135,8 +145,8 @@ private def shell(String command) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private def serverStart(String serverName) {
|
private def serverStart(String serverName, String serverFlags, String hostname) {
|
||||||
def proc = shell("ssh -t ${hostname} \"./mc ${serverName}\"")
|
def proc = shell("ssh -t ${hostname} \"./mc ${serverFlags} ${serverName}\"")
|
||||||
|
|
||||||
Set<String> strings = new HashSet<>()
|
Set<String> strings = new HashSet<>()
|
||||||
File file = new File("${projectDir}/ignoredlog");
|
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