From 0f9fd46d2948a8e1385bcd55780227c73a38495d Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Sat, 22 Feb 2020 05:46:01 +0100 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=9F=D0=BE=D1=81=D0=BB=D0=B5=D0=B4?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=D0=B0=D1=80=D0=BD=D1=8B=20=D0=BE=20?= =?UTF-8?q?=D0=BD=D0=B5=D1=81=D0=BE=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BC=D0=BE=D1=81=D1=82=D0=B8=20=D1=81=20Gradle=207.0/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LaunchServer/build.gradle | 1 + .../gravit/launchserver/binary/tasks/PrepareBuildTask.java | 2 +- Launcher/build.gradle | 7 ++++++- .../src/main/java/pro/gravit/utils/helper/IOHelper.java | 7 +++++++ modules | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/LaunchServer/build.gradle b/LaunchServer/build.gradle index 3afe323d..8fec5a20 100644 --- a/LaunchServer/build.gradle +++ b/LaunchServer/build.gradle @@ -32,6 +32,7 @@ dependsOn parent.childProjects.Launcher.tasks.build from { configurations.pack.collect { it.isDirectory() ? it : zipTree(it) } } from(parent.childProjects.Launcher.tasks.shadowJar.archivePath) + from(parent.childProjects.Launcher.tasks.genRuntimeJS.archivePath) manifest.attributes("Main-Class": mainClassName, "Premain-Class": mainAgentName, "Can-Redefine-Classes": "true", diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/PrepareBuildTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/PrepareBuildTask.java index b412fb5b..0b9d3256 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/PrepareBuildTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/PrepareBuildTask.java @@ -45,8 +45,8 @@ public boolean allowDelete() { public void tryUnpack() throws IOException { LogHelper.info("Unpacking launcher native guard list and runtime"); - UnpackHelper.unpackZipNoCheck("guard.zip", server.launcherBinary.guardDir); UnpackHelper.unpackZipNoCheck("runtime.zip", server.launcherBinary.runtimeDir); + IOHelper.keepDir(server.launcherBinary.guardDir); } private static final class ListFileVisitor extends SimpleFileVisitor { diff --git a/Launcher/build.gradle b/Launcher/build.gradle index 7c01ec74..eb424741 100644 --- a/Launcher/build.gradle +++ b/Launcher/build.gradle @@ -62,8 +62,13 @@ task dumpLibs(type: Copy) { from configurations.bundle } +task genRuntimeJS(type: Zip) { + archiveFileName = "runtime.zip" + destinationDirectory = file("${buildDir}/tmp") + from "runtime/" +} -assemble.dependsOn tasks.dumpLibs, tasks.shadowJar +assemble.dependsOn tasks.genRuntimeJS, tasks.dumpLibs, tasks.shadowJar publishing { publications { diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java index f5defefe..755a7bf9 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java @@ -733,4 +733,11 @@ public static void write(Path file, byte[] bytes) throws IOException { private IOHelper() { } + + public static void keepDir(Path dir) throws IOException { + if (Files.isDirectory(dir)) + return; + Files.deleteIfExists(dir); + Files.createDirectory(dir); + } } diff --git a/modules b/modules index d430430a..6df9e7b0 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit d430430a83080312a420ee6b91d335b23d75c693 +Subproject commit 6df9e7b0fb74623336baaf8a1c53c2073dce4ffd