[FIX] Запаковка netty в ServerWrapper.

This commit is contained in:
zaxar163 2019-04-29 09:56:39 +03:00
parent 323cfe763a
commit a921fde598
No known key found for this signature in database
GPG key ID: E3B309DD3852DE06
4 changed files with 26 additions and 5 deletions

View file

@ -20,9 +20,9 @@
-keepattributes Signature -keepattributes Signature
-adaptresourcefilecontents META-INF/MANIFEST.MF -adaptresourcefilecontents META-INF/MANIFEST.MF
-keeppackagenames com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,oshi.**,com.sun.jna.**,com.google.gson.**,org.slf4j.**,oshi.jna.**,com.sun.jna.**,org.apache.commons.logging.**, org.fusesource.**, com.jfoenix.** -keeppackagenames com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,com.google.gson.**,ru.gravit.repackage.**,org.fusesource.**
-keep class com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,oshi.**,com.sun.jna.**,com.google.gson.**,org.slf4j.**,oshi.jna.**,com.sun.jna.**,org.apache.commons.logging.**, org.fusesource.**, com.jfoenix.** { -keep class com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,com.google.gson.**,ru.gravit.repackage.**,org.fusesource.** {
*; *;
} }

View file

@ -36,10 +36,11 @@
} }
dependencies { dependencies {
pack project(':LauncherAPI') // Not error on obf. pack project(':LauncherAPI')
bundle 'com.github.oshi:oshi-core:3.13.0' bundle 'com.github.oshi:oshi-core:3.13.0'
bundle 'com.jfoenix:jfoenix:8.0.8' bundle 'com.jfoenix:jfoenix:8.0.8'
bundle 'de.jensd:fontawesomefx:8.9' bundle 'de.jensd:fontawesomefx:8.9'
bundle 'org.apache.httpcomponents:httpclient:4.5.7'
pack 'io.netty:netty-all:4.1.32.Final' pack 'io.netty:netty-all:4.1.32.Final'
pack 'org.ow2.asm:asm-tree:7.1' pack 'org.ow2.asm:asm-tree:7.1'
} }

View file

@ -4,7 +4,7 @@
dependencies { dependencies {
compile project(':libLauncher') compile project(':libLauncher')
compileOnly 'io.netty:netty-all:4.1.32.Final' compileOnly 'io.netty:netty-all:4.1.32.Final'
compile 'org.apache.httpcomponents:httpclient:4.5.7' compileOnly 'org.apache.httpcomponents:httpclient:4.5.7'
compileOnly 'com.google.guava:guava:26.0-jre' compileOnly 'com.google.guava:guava:26.0-jre'
compile files('../compat/authlib/authlib-clean.jar') compile files('../compat/authlib/authlib-clean.jar')
} }

View file

@ -1,6 +1,12 @@
apply plugin: 'com.github.johnrengelman.shadow'
String mainClassName = "ru.gravit.launcher.server.ServerWrapper" String mainClassName = "ru.gravit.launcher.server.ServerWrapper"
String mainAgentName = "ru.gravit.launcher.server.ServerAgent" String mainAgentName = "ru.gravit.launcher.server.ServerAgent"
configurations {
pack
compile.extendsFrom pack
}
repositories { repositories {
maven { maven {
@ -12,6 +18,7 @@
targetCompatibility = '1.8' targetCompatibility = '1.8'
jar { jar {
classifier = 'clean'
from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } } from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } }
manifest.attributes("Main-Class": mainClassName, manifest.attributes("Main-Class": mainClassName,
"Premain-Class": mainAgentName, "Premain-Class": mainAgentName,
@ -21,5 +28,18 @@
} }
dependencies { dependencies {
compile project(':LauncherAPI') pack project(':LauncherAPI')
pack 'org.apache.httpcomponents:httpclient:4.5.7'
pack 'io.netty:netty-all:4.1.32.Final'
} }
shadowJar {
classifier = null
relocate 'io.netty', 'ru.gravit.repackage.io.netty'
configurations = [project.configurations.pack]
exclude 'module-info.class'
}
build.dependsOn tasks.shadowJar