diff --git a/LaunchServer/build.gradle b/LaunchServer/build.gradle index 5cadc5a7..f0ffb603 100644 --- a/LaunchServer/build.gradle +++ b/LaunchServer/build.gradle @@ -8,7 +8,7 @@ url "https://oss.sonatype.org/content/repositories/snapshots" } maven { - url "http://maven.geomajas.org/" + url "https://maven.geomajas.org/" } } @@ -24,7 +24,7 @@ launch4j launch4jCJ bundleOnly.extendsFrom bundle - compile.extendsFrom bundle, hikari, pack, launch4jCJ, launch4j + api.extendsFrom bundle, hikari, pack, launch4jCJ, launch4j } jar { @@ -114,15 +114,17 @@ pack project(':LauncherAPI') compileOnlyA 'com.google.guava:guava:26.0-jre' compileOnlyA 'log4j:log4j:1.2.17' // Do not update (laggy dep). compileOnlyA 'org.apache.logging.log4j:log4j-core:2.11.2' - testCompile 'org.junit.jupiter:junit-jupiter:5.4.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.4.1' } task hikari(type: Copy) { + duplicatesStrategy = 'EXCLUDE' into "$buildDir/libs/libraries/hikaricp" from configurations.hikari } task launch4jM(type: Copy) { + duplicatesStrategy = 'EXCLUDE' into "$buildDir/libs/libraries/launch4j" from(configurations.launch4jCJ.collect { it.isDirectory() ? it : zipTree(it) }) includeEmptyDirs false @@ -139,6 +141,7 @@ task launch4jM(type: Copy) { } task launch4jA(type: Copy) { + duplicatesStrategy = 'EXCLUDE' into "$buildDir/libs/libraries/launch4j" from(configurations.launch4j) includeEmptyDirs false @@ -151,17 +154,20 @@ task launch4jA(type: Copy) { } task dumpLibs(type: Copy) { + duplicatesStrategy = 'EXCLUDE' dependsOn tasks.hikari, tasks.launch4jM, tasks.launch4jA into "$buildDir/libs/libraries" from configurations.bundleOnly } task dumpCompileOnlyLibs(type: Copy) { + duplicatesStrategy = 'EXCLUDE' into "$buildDir/libs/launcher-libraries-compile" from configurations.compileOnlyA } task bundle(type: Zip) { + duplicatesStrategy = 'EXCLUDE' dependsOn parent.childProjects.Launcher.tasks.build, tasks.dumpLibs, tasks.dumpCompileOnlyLibs, tasks.jar archiveName 'LaunchServer.zip' destinationDir file("$buildDir") diff --git a/Launcher/build.gradle b/Launcher/build.gradle index b99e62a8..042d5afb 100644 --- a/Launcher/build.gradle +++ b/Launcher/build.gradle @@ -1,6 +1,4 @@ -plugins { - id 'org.openjfx.javafxplugin' version '0.0.5' -} +apply plugin: 'org.openjfx.javafxplugin' apply plugin: 'com.github.johnrengelman.shadow' String mainClassName = "pro.gravit.launcher.ClientLauncherWrapper" @@ -8,7 +6,7 @@ repositories { maven { - url "http://repo.spring.io/plugins-release/" + url "https://repo.spring.io/plugins-release/" } } javafx { @@ -21,7 +19,7 @@ configurations { bundle pack - compile.extendsFrom bundle, pack + api.extendsFrom bundle, pack } jar { @@ -45,6 +43,7 @@ task javadocJar(type: Jar) { } shadowJar { + duplicatesStrategy = 'EXCLUDE' classifier = null relocate 'org.objectweb.asm', 'pro.gravit.repackage.org.objectweb.asm' relocate 'io.netty', 'pro.gravit.repackage.io.netty' @@ -60,12 +59,14 @@ pack project(':LauncherAPI') } task genRuntimeJS(type: Zip) { + duplicatesStrategy = 'EXCLUDE' archiveName = "runtime.zip" destinationDir = file("${buildDir}/tmp") from "runtime/" } task dumpLibs(type: Copy) { + duplicatesStrategy = 'EXCLUDE' into "$buildDir/libs/libraries" from configurations.bundle } diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java index 301cd7b1..3fa33b85 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java @@ -59,13 +59,7 @@ public static void checkClass(Class clazz) throws SecurityException { public static void exitLauncher(int code) { modulesManager.invokeEvent(new ClientExitPhase(code)); - try { - System.exit(code); - } catch (Exception e) //Forge Security Manager? - { - NativeJVMHalt.haltA(code); - } - + NativeJVMHalt.haltA(code); } public static void main(String... args) throws Throwable { diff --git a/Launcher/src/main/java/pro/gravit/launcher/patches/FMLPatcher.java b/Launcher/src/main/java/pro/gravit/launcher/patches/FMLPatcher.java index 79b7a085..fb325aab 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/patches/FMLPatcher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/patches/FMLPatcher.java @@ -10,6 +10,7 @@ import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.nio.ByteBuffer; +import java.util.Locale; import java.util.Random; import java.util.Vector; @@ -87,7 +88,8 @@ private static byte[] gen(final String name, final String exName) { // "cpw/mods } public static String randomStr(final int lenght) { - final String alphabet = "abcdefghijklmnopqrstuvwxyz"; + String alphabet = "abcdefghijklmnopqrstuvwxyz"; + alphabet += alphabet.toUpperCase(Locale.US); final StringBuilder sb = new StringBuilder(lenght); final Random random = SecurityHelper.newRandom(); for (int i = 0; i < lenght; i++) diff --git a/LauncherAPI/build.gradle b/LauncherAPI/build.gradle index c6382a08..3cb0f2c7 100644 --- a/LauncherAPI/build.gradle +++ b/LauncherAPI/build.gradle @@ -2,9 +2,9 @@ targetCompatibility = '1.8' dependencies { - compile project(':LauncherCore') + api project(':LauncherCore') compileOnly 'io.netty:netty-codec-http:4.1.43.Final' - testCompile 'org.junit.jupiter:junit-jupiter:5.4.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.4.1' } test { diff --git a/LauncherAuthlib/build.gradle b/LauncherAuthlib/build.gradle index c80e6841..b0be2cb6 100644 --- a/LauncherAuthlib/build.gradle +++ b/LauncherAuthlib/build.gradle @@ -2,7 +2,7 @@ targetCompatibility = '1.8' dependencies { - compile project(':LauncherAPI') + api project(':LauncherAPI') compileOnly 'com.google.guava:guava:26.0-jre' - compile files('../compat/authlib/authlib-clean.jar') + api files('../compat/authlib/authlib-clean.jar') } diff --git a/LauncherCore/build.gradle b/LauncherCore/build.gradle index c4783f31..40e2fe6e 100644 --- a/LauncherCore/build.gradle +++ b/LauncherCore/build.gradle @@ -1,4 +1,3 @@ -apply plugin: 'java-library' sourceCompatibility = '1.8' targetCompatibility = '1.8' @@ -8,8 +7,8 @@ compileOnly 'org.jline:jline-reader:3.11.0' compileOnly 'org.jline:jline-terminal:3.11.0' compileOnly 'org.bouncycastle:bcprov-jdk15:1.46' - compile 'com.google.code.gson:gson:2.8.5' - testCompile 'org.junit.jupiter:junit-jupiter:5.4.1' + api 'com.google.code.gson:gson:2.8.5' + testImplementation 'org.junit.jupiter:junit-jupiter:5.4.1' } test { diff --git a/ServerWrapper/build.gradle b/ServerWrapper/build.gradle index 9db86cf6..0c801681 100644 --- a/ServerWrapper/build.gradle +++ b/ServerWrapper/build.gradle @@ -5,12 +5,12 @@ configurations { pack - compile.extendsFrom pack + api.extendsFrom pack } repositories { maven { - url "http://repo.spring.io/plugins-release/" + url "https://repo.spring.io/plugins-release/" } } @@ -42,6 +42,7 @@ pack project(':LauncherAuthlib') } shadowJar { + duplicatesStrategy = 'EXCLUDE' classifier = null relocate 'io.netty', 'pro.gravit.repackage.io.netty' configurations = [project.configurations.pack] diff --git a/build.gradle b/build.gradle index c071da22..49138327 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,8 @@ plugins { - id 'com.github.johnrengelman.shadow' version '5.0.0' apply false + id 'com.github.johnrengelman.shadow' version '5.2.0' apply false id 'maven-publish' id 'signing' + id 'org.openjfx.javafxplugin' version '0.0.7' apply false } group = 'pro.gravit.launcher' version = '5.1.1-SNAPSHOT' @@ -10,30 +11,34 @@ apply plugin: 'idea' apply plugin: 'eclipse' apply plugin: 'java' + apply plugin: 'java-library' + group = 'pro.gravit' repositories { mavenCentral() - maven { url 'http://oss.sonatype.org/content/groups/public' } + maven { url 'https://oss.sonatype.org/content/groups/public' } maven { - url "http://clojars.org/repo/" + url "https://clojars.org/repo/" } } - configurations { - apt - aptCompileOnly - aptOnly - aptOnly.extendsFrom apt, aptCompileOnly - compile.extendsFrom apt - compileOnly.extendsFrom aptCompileOnly + jar { + duplicatesStrategy = 'EXCLUDE' + } + + eclipse { + classpath { + plusConfigurations += [ configurations.compileOnly ] + downloadSources = true + downloadJavadoc = true + } } tasks.withType(JavaCompile) { options.encoding = "UTF-8" options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" - options.annotationProcessorPath = configurations.aptOnly options.incremental = true // one flag, and things will get MUCH faster } } diff --git a/modules b/modules index c5952e71..55982085 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit c5952e71d96b2b02bdaee4e415fd60a844c85876 +Subproject commit 559820852c231b7045b2c12fabbde1261485a75e