Hotfix build.gradle
Dieser Commit ist enthalten in:
Ursprung
c69c81283d
Commit
641f9ef443
17
build.gradle
17
build.gradle
@ -17,6 +17,8 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.tools.ant.taskdefs.condition.Os
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
// Adding the base plugin fixes the following gradle warnings in IntelliJ:
|
// Adding the base plugin fixes the following gradle warnings in IntelliJ:
|
||||||
//
|
//
|
||||||
@ -40,6 +42,12 @@ ext {
|
|||||||
uberJarName = "${artifact}-all.jar"
|
uberJarName = "${artifact}-all.jar"
|
||||||
jarName = "${artifact}.jar"
|
jarName = "${artifact}.jar"
|
||||||
libs = "${buildDir}/libs"
|
libs = "${buildDir}/libs"
|
||||||
|
|
||||||
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||||
|
operatinSystem = "windows"
|
||||||
|
} else {
|
||||||
|
operatinSystem = "unix"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileJava.options.encoding = 'UTF-8'
|
compileJava.options.encoding = 'UTF-8'
|
||||||
@ -105,7 +113,12 @@ if (project.hasProperty("hostname")) {
|
|||||||
* @return the trimmed result from stdout, stderr and the exit value
|
* @return the trimmed result from stdout, stderr and the exit value
|
||||||
*/
|
*/
|
||||||
def shell(String command) {
|
def shell(String command) {
|
||||||
def proc = ['bash', '-c', command].execute()
|
def proc
|
||||||
|
if (operatinSystem == "unix") {
|
||||||
|
proc = ['bash', '-c', command].execute()
|
||||||
|
} else {
|
||||||
|
proc = [command].execute()
|
||||||
|
}
|
||||||
def out = new StringBuilder()
|
def out = new StringBuilder()
|
||||||
def err = new StringBuilder()
|
def err = new StringBuilder()
|
||||||
proc.waitForProcessOutput(out, err)
|
proc.waitForProcessOutput(out, err)
|
||||||
@ -116,5 +129,5 @@ def shell(String command) {
|
|||||||
def answer(String question) {
|
def answer(String question) {
|
||||||
while (System.in.available() > 0) System.in.read()
|
while (System.in.available() > 0) System.in.read()
|
||||||
println(question)
|
println(question)
|
||||||
return "Yy".contains(((char)System.in.read()).toString())
|
return "Yy".contains(((char) System.in.read()).toString())
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren