From a238f79fe653619d20e9c49b54d900186f7949a1 Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Tue, 8 Jan 2019 17:41:13 +0400 Subject: [PATCH] Also fixes. --- .../launchserver/binary/JARLauncherBinary.java | 14 +++++++------- .../launchserver/binary/tasks/UnpackBuildTask.java | 2 +- .../src/main/java/ru/gravit/utils/HTTPRequest.java | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) 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 287e87ad..24f3fae7 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java @@ -18,24 +18,24 @@ import ru.gravit.utils.helper.LogHelper; public final class JARLauncherBinary extends LauncherBinary { - public ArrayList tasks; public final AtomicLong count; public final Path runtimeDir; public final Path guardDir; public final Path buildDir; - + public ArrayList tasks; + public JARLauncherBinary(LaunchServer server) throws IOException { super(server); - tasks = new ArrayList<>(); - tasks.add(new UnpackBuildTask(server)); - tasks.add(new MainBuildTask(server)); - if(server.config.enabledProGuard) tasks.add(new ProGuardBuildTask(server)); - if(server.config.stripLineNumbers) tasks.add(new StripLineNumbersTask(server)); count = new AtomicLong(0); syncBinaryFile = server.dir.resolve(server.config.binaryName + ".jar"); runtimeDir = server.dir.resolve(Launcher.RUNTIME_DIR); guardDir = server.dir.resolve(Launcher.GUARD_DIR); buildDir = server.dir.resolve("build"); + tasks = new ArrayList<>(); + tasks.add(new UnpackBuildTask(server)); + tasks.add(new MainBuildTask(server)); + if(server.config.enabledProGuard) tasks.add(new ProGuardBuildTask(server)); + if(server.config.stripLineNumbers) tasks.add(new StripLineNumbersTask(server)); } @Override diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/UnpackBuildTask.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/UnpackBuildTask.java index b4919b1a..59b43d4e 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/UnpackBuildTask.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/UnpackBuildTask.java @@ -14,7 +14,7 @@ public class UnpackBuildTask implements LauncherBuildTask { public UnpackBuildTask(LaunchServer server) { this.server = server; - result = server.dir.resolve(server.config.binaryName + "-clean.jar"); + result = server.launcherBinary.buildDir.resolve(server.config.binaryName + "-clean.jar"); } @Override diff --git a/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java b/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java index 55627a3a..20eb5292 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java +++ b/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java @@ -65,4 +65,3 @@ public static JsonElement jsonRequest(JsonElement request, URL url) throws IOExc private HTTPRequest() { } } -}