From 80e919f4a1108b4d1226e49ea77d5c31533c5cfd Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 5 May 2020 06:40:03 +0700 Subject: [PATCH] =?UTF-8?q?[ANY]=20=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BD=D0=B0=20=D0=BD=D0=B0=D0=BB=D0=B8=D1=87?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2=20javafx=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20proguard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binary/tasks/ProGuardBuildTask.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/ProGuardBuildTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/ProGuardBuildTask.java index 3fc2636c..af4f2d8b 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/ProGuardBuildTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/ProGuardBuildTask.java @@ -2,6 +2,7 @@ import pro.gravit.launchserver.LaunchServer; import pro.gravit.utils.helper.IOHelper; +import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; import proguard.Configuration; import proguard.ConfigurationParser; @@ -10,6 +11,7 @@ import java.io.IOException; import java.nio.file.Path; +import java.nio.file.Paths; public class ProGuardBuildTask implements LauncherBuildTask { private final LaunchServer server; @@ -30,6 +32,21 @@ public Path process(Path inputFile) throws IOException { Configuration proguard_cfg = new Configuration(); ConfigurationParser parser = new ConfigurationParser(server.proguardConf.buildConfig(inputFile, outputJar), server.proguardConf.proguard.toFile(), System.getProperties()); + if (JVMHelper.JVM_VERSION >= 9) + { + Path javaJModsPath = Paths.get(System.getProperty("java.home")).resolve("jmods"); + if(!IOHelper.exists(javaJModsPath)) + { + LogHelper.warning("Directory %s not found. It is not good", javaJModsPath); + } + else + { + //Find javaFX libraries + if(!IOHelper.exists(javaJModsPath.resolve("javafx.base.jmod"))) LogHelper.warning("javafx.base.jmod not found. Launcher can be assembled incorrectly. Maybe you need to install OpenJFX?"); + if(!IOHelper.exists(javaJModsPath.resolve("javafx.graphics.jmod"))) LogHelper.warning("javafx.graphics.jmod not found. Launcher can be assembled incorrectly. Maybe you need to install OpenJFX?"); + if(!IOHelper.exists(javaJModsPath.resolve("javafx.controls.jmod"))) LogHelper.warning("javafx.controls.jmod not found. Launcher can be assembled incorrectly. Maybe you need to install OpenJFX?"); + } + } try { parser.parse(proguard_cfg); ProGuard proGuard = new ProGuard(proguard_cfg);