From e7516edc57becb3eefe8747966b200e695b173c8 Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Tue, 29 Jan 2019 13:06:45 +0300 Subject: [PATCH] =?UTF-8?q?gradle:=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0?= =?UTF-8?q?=D1=87=D0=B0=20System=20properties=20=D0=B2=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D0=BA=D0=B0=D0=B5=D0=BC=D1=8B=D0=B9=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 6d1adf3..f299caa 100644 --- a/build.gradle +++ b/build.gradle @@ -137,11 +137,8 @@ subprojects { * Запуск сервера. * Для указания рабочей папки, указываем JVM параметр * -DworkDir=path\to\workdir - * Если используется отдельная папка для имплементации логгера, то указываем + * Если используется отдельная папка для имплементации логгера, то указываем * -DlogImplDir=path\to\logimpldir - * Если необходимо передать дополнительные JVM параметры серверу, то указываем их с двойной "D", например: - * -DDspringConfig=spring.xml - * -DDlog4j.configurationFile=log4j2.xml */ task runServer(type: JavaExec) { main = 'mc.core.Main' @@ -153,14 +150,19 @@ task runServer(type: JavaExec) { } if (System.getProperty("logImplDir") != null) { - classpath += files(fileTree(dir: new File(System.getProperty("logImplDir")))) + def logImplDir = new File(System.getProperty("logImplDir")) + + if (logImplDir.isAbsolute()) { + classpath += files(fileTree(dir: logImplDir)) + } else { + classpath += files(fileTree(dir: new File(workingDir, logImplDir.getPath()))) + } } else { classpath += files(fileTree(dir: new File(workingDir, "log-impl"))) } - - System.getProperties().stringPropertyNames().stream() - .filter{propName -> propName.startsWith("D")} - .forEach{propName -> jvmArgs += "-D" + propName.substring(1) + "=" + System.getProperty(propName)} + + systemProperties System.properties + systemProperties.put("user.dir", workingDir) ignoreExitValue = true }