diff --git a/LaunchServer/build.gradle b/LaunchServer/build.gradle index 503d2d56..3bae29c2 100644 --- a/LaunchServer/build.gradle +++ b/LaunchServer/build.gradle @@ -30,7 +30,8 @@ jar { dependsOn parent.childProjects.Launcher.tasks.build from { configurations.pack.collect { it.isDirectory() ? it : zipTree(it) } } - from(parent.childProjects.Launcher.tasks.jar.archivePath, parent.childProjects.Launcher.tasks.genRuntimeJS.archivePath) + 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/Launcher/build.gradle b/Launcher/build.gradle index 83d594fd..9a721242 100644 --- a/Launcher/build.gradle +++ b/Launcher/build.gradle @@ -1,3 +1,5 @@ +apply plugin: 'com.github.johnrengelman.shadow' + String mainClassName = "ru.gravit.launcher.ClientLauncherWrapper" String mainAgentName = "ru.gravit.launcher.LauncherAgent" @@ -17,7 +19,7 @@ } jar { - from { configurations.pack.collect { it.isDirectory() ? it : zipTree(it) } } + classifier = 'clean' manifest.attributes("Main-Class": mainClassName, "Premain-Class": mainAgentName, "Can-Redefine-Classes": "true", @@ -25,10 +27,17 @@ "Can-Set-Native-Method-Prefix": "true") } +shadowJar { + classifier = null + relocate 'org.objectweb.asm', 'ru.gravit.repackage.org.objectweb.asm' + configurations = [project.configurations.pack] + exclude 'module-info.class' +} + dependencies { pack project(':LauncherAPI') // Not error on obf. bundle 'com.github.oshi:oshi-core:3.13.0' - compileOnly 'org.ow2.asm:asm-all:5.0.3' + pack 'org.ow2.asm:asm-tree:7.1' } task genRuntimeJS(type: Zip) { @@ -43,4 +52,4 @@ task dumpLibs(type: Copy) { } -build.dependsOn tasks.genRuntimeJS, tasks.dumpLibs +build.dependsOn tasks.genRuntimeJS, tasks.dumpLibs, tasks.shadowJar diff --git a/build.gradle b/build.gradle index 02d6daae..c2439fbf 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'com.github.johnrengelman.shadow' version '5.0.0' apply false +} + configure(subprojects.findAll { it.name != 'modules' && it.name != 'Radon' }) { apply plugin: 'idea' apply plugin: 'eclipse'