From 03d53d4a097bb495728f878eb941181893c9b9cd Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sat, 6 Jul 2024 02:59:36 +0700 Subject: [PATCH] [FEATURE] Support -Dlaunchserver.dir.libraries --- LaunchServer/src/main/java/pro/gravit/launchserver/Main.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java b/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java index 8ca8b467..aabf4fe1 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java @@ -21,6 +21,7 @@ public class Main { private static final List classpathOnly = List.of("proguard", "jline", "progressbar", "kotlin", "epoll"); private static final String LOG4J_PROPERTY = "log4j2.configurationFile"; private static final String DEBUG_PROPERTY = "launchserver.main.debug"; + private static final String LIBRARIES_PROPERTY = "launchserver.dir.libraries"; private static boolean isClasspathOnly(Path path) { var fileName = path.getFileName().toString(); for(var e : classpathOnly) { @@ -56,8 +57,9 @@ public static void main(String[] args) throws Throwable { ModuleLaunch launch = new ModuleLaunch(); LaunchOptions options = new LaunchOptions(); options.moduleConf = new LaunchOptions.ModuleConf(); + Path librariesPath = Path.of(System.getProperty(LIBRARIES_PROPERTY, "libraries")); List libraries; - try(Stream files = Files.walk(Path.of("libraries"), FileVisitOption.FOLLOW_LINKS)) { + try(Stream files = Files.walk(librariesPath, FileVisitOption.FOLLOW_LINKS)) { libraries = new ArrayList<>(files.filter(e -> e.getFileName().toString().endsWith(".jar")).toList()); } List classpath = new ArrayList<>();