From a032e1546a80012532ebf86b677354605b8349c2 Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Wed, 9 Jan 2019 13:20:31 +0400 Subject: [PATCH] Final fixes. --- .../src/main/java/ru/gravit/launchserver/LaunchServer.java | 4 ++-- .../java/ru/gravit/launchserver/binary/JARLauncherBinary.java | 2 +- .../ru/gravit/launchserver/binary/tasks/AttachJarsTask.java | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index 2c12a91b..e134fbc3 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -590,8 +590,8 @@ private void generateConfigIfNotExists() throws IOException { newConfig.threadCount = JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors() >= 4 ? JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors() / 2 : JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors(); newConfig.enabledProGuard = true; - newConfig.stripLineNumbers = false; - newConfig.deleteTempFiles = false; + newConfig.stripLineNumbers = true; + newConfig.deleteTempFiles = true; // Set server address LogHelper.println("LaunchServer address: "); newConfig.setAddress(commandHandler.readLine()); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java index ba79df3d..6d207969 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java @@ -78,7 +78,7 @@ public void build() throws IOException { } public String nextName(String taskName) { - return String.format("Launcher-%s-%d.jar", server.config.projectName, taskName, count.getAndIncrement()); + return String.format("Launcher-%s-%d.jar", taskName, count.getAndIncrement()); } public Path nextPath(String taskName) { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/AttachJarsTask.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/AttachJarsTask.java index a46871be..6301498f 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/AttachJarsTask.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/AttachJarsTask.java @@ -10,6 +10,7 @@ import ru.gravit.launchserver.LaunchServer; import ru.gravit.utils.helper.IOHelper; +import ru.gravit.utils.helper.LogHelper; public class AttachJarsTask implements LauncherBuildTask { private final LaunchServer srv; @@ -51,11 +52,12 @@ public Path process(Path inputFile) throws IOException { private void attach(ZipOutputStream output, List lst) throws IOException { for (Path p : lst) { + LogHelper.debug("Attaching: " + p); try (ZipInputStream input = IOHelper.newZipInput(p)) { ZipEntry e = input.getNextEntry(); while (e != null) { String filename = e.getName(); - if (exclusions.stream().noneMatch(filename::startsWith) && !srv.buildHookManager.isContainsBlacklist(filename)) { + if (exclusions.stream().noneMatch(filename::startsWith) && !srv.buildHookManager.isContainsBlacklist(filename) && !e.isDirectory()) { output.putNextEntry(IOHelper.newZipEntry(e)); IOHelper.transfer(input, output); }