Work around for ForgeGradle problems with shadow jars

This commit is contained in:
Mike Primm 2018-09-06 10:31:57 -05:00
parent ff36c50e06
commit 27cdd8e483

View File

@ -13,11 +13,10 @@ buildscript {
} }
apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.johnrengelman.shadow'
dependencies { dependencies {
compile project(path: ":DynmapCoreAPI", configuration: "shadow") compile project(":DynmapCore")
compile project(path: ":DynmapCore", configuration: "shadow") compile project(":DynmapCoreAPI")
} }
sourceCompatibility = 1.8 sourceCompatibility = 1.8
@ -62,16 +61,31 @@ processResources
rename '(.+_at.cfg)', 'META-INF/$1' rename '(.+_at.cfg)', 'META-INF/$1'
} }
shadowJar { jar {
dependencies {
include(dependency(':DynmapCore'))
}
archiveName = "Dynmap-${parent.version}-forge-1.12.2.jar"
destinationDir = file '../target'
manifest { manifest {
attributes 'FMLAT': 'dynmap_at.cfg' attributes 'FMLAT': 'dynmap_at.cfg'
} }
} }
shadowJar {
dependencies {
include(dependency('com.googlecode.json-simple:json-simple:'))
include(dependency('org.yaml:snakeyaml:'))
include(dependency('com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:'))
include(dependency('org.eclipse.jetty::'))
include(dependency('org.eclipse.jetty.orbit:javax.servlet:'))
include(dependency(':DynmapCore'))
include(dependency(':DynmapCoreAPI'))
}
relocate('org.json.simple', 'org.dynmap.json.simple')
relocate('org.yaml.snakeyaml', 'org.dynmap.snakeyaml')
relocate('org.eclipse.jetty', 'org.dynmap.jetty')
relocate('org.owasp.html', 'org.dynmap.org.owasp.html')
relocate('javax.servlet', 'org.dynmap.javax.servlet' )
archiveName = "Dynmap-${parent.version}-forge-1.12.2.jar"
destinationDir = file '../target'
}
shadowJar.doLast { shadowJar.doLast {
task -> task ->
ant.checksum file: task.archivePath ant.checksum file: task.archivePath