Final fixes.

This commit is contained in:
zaxar163 2019-01-09 13:20:31 +04:00
parent 329f38b1cc
commit a032e1546a
No known key found for this signature in database
GPG key ID: CEE900027AE098E0
3 changed files with 6 additions and 4 deletions

View file

@ -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());

View file

@ -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) {

View file

@ -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<Path> 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);
}