From ab884c8d23b8ac1f7ca8905596f7c732e4e1fb8a Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Thu, 18 Jan 2024 00:13:36 +0700 Subject: [PATCH] [FEATURE] Add ProGuard jvmArgs --- .../gravit/launchserver/components/ProGuardComponent.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java index f30ab0b4..ee92b7e0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java @@ -34,6 +34,7 @@ public class ProGuardComponent extends Component implements AutoCloseable, Recon private static final Logger logger = LogManager.getLogger(); public String modeAfter = "MainBuild"; public String dir = "proguard"; + public List jvmArgs = new ArrayList<>(); public boolean enabled = true; public boolean mappings = true; public transient ProguardConf proguardConf; @@ -41,6 +42,10 @@ public class ProGuardComponent extends Component implements AutoCloseable, Recon private transient ProGuardBuildTask buildTask; private transient ProGuardMultiReleaseFixer fixerTask; + public ProGuardComponent() { + this.jvmArgs.add("-Xmx512M"); + } + public static boolean checkFXJMods(Path path) { if (!IOHelper.exists(path.resolve("javafx.base.jmod"))) return false; @@ -208,6 +213,7 @@ public Path process(Path inputFile) throws IOException { try { List args = new ArrayList<>(); args.add(IOHelper.resolveJavaBin(IOHelper.JVM_DIR).toAbsolutePath().toString()); + args.addAll(component.jvmArgs); args.add("-cp"); try(Stream files = Files.walk(Path.of("libraries"), FileVisitOption.FOLLOW_LINKS)) { args.add(files