Skip to content

Commit

Permalink
[FEATURE] Support -Dlaunchserver.dir.libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
gravit0 committed Jul 5, 2024
1 parent c261496 commit 03d53d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion LaunchServer/src/main/java/pro/gravit/launchserver/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class Main {
private static final List<String> 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) {
Expand Down Expand Up @@ -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<Path> libraries;
try(Stream<Path> files = Files.walk(Path.of("libraries"), FileVisitOption.FOLLOW_LINKS)) {
try(Stream<Path> files = Files.walk(librariesPath, FileVisitOption.FOLLOW_LINKS)) {
libraries = new ArrayList<>(files.filter(e -> e.getFileName().toString().endsWith(".jar")).toList());
}
List<Path> classpath = new ArrayList<>();
Expand Down

0 comments on commit 03d53d4

Please sign in to comment.