diff --git a/build.gradle b/build.gradle index 19a1c131f..49eea452c 100644 --- a/build.gradle +++ b/build.gradle @@ -38,6 +38,34 @@ subprojects { workingDir = new File(rootDir, "run/") workingDir.mkdirs() } + + // Work around gradle shadow bug + // see https://github.com/johnrengelman/shadow/issues/713 + afterEvaluate { + startScripts { + dependsOn(shadowJar) + } + + distTar { + dependsOn(shadowJar) + } + + distZip { + dependsOn(shadowJar) + } + + startShadowScripts { + dependsOn(jar) + } + + shadowDistTar { + dependsOn(jar) + } + + shadowDistZip { + dependsOn(jar) + } + } } task clean { diff --git a/creator-tools/build.gradle b/creator-tools/build.gradle index 72f9ff296..0905e6d0b 100644 --- a/creator-tools/build.gradle +++ b/creator-tools/build.gradle @@ -11,7 +11,7 @@ application { } dependencies { - implementation project(path: ':launcher-builder', configuration: 'shadow') + implementation project(path: ':launcher-builder') implementation 'org.eclipse.jetty:jetty-server:9.3.1.v20150714' implementation 'com.jidesoft:jide-oss:3.6.18' } diff --git a/launcher-builder/build.gradle b/launcher-builder/build.gradle index a3b56238f..224895771 100644 --- a/launcher-builder/build.gradle +++ b/launcher-builder/build.gradle @@ -15,9 +15,14 @@ dependencies { } shadowJar { + dependsOn ':launcher:shadowJar' archiveClassifier.set("") } -build { - dependsOn(shadowJar) -} +// Work around gradle shadow bug +// see https://github.com/johnrengelman/shadow/issues/713 +startScripts.dependsOn(':launcher:shadowJar') +distTar.dependsOn(':launcher:shadowJar') +distZip.dependsOn(':launcher:shadowJar') + +build.dependsOn(shadowJar) diff --git a/launcher-fancy/build.gradle b/launcher-fancy/build.gradle index 4c38b22b0..e387be495 100644 --- a/launcher-fancy/build.gradle +++ b/launcher-fancy/build.gradle @@ -16,14 +16,21 @@ repositories { } dependencies { - implementation project(path: ':launcher', configuration: 'shadow') + implementation project(path: ':launcher') implementation 'io.github.cottonmc.insubstantial:substance:7.3.1-SNAPSHOT' } shadowJar { + dependsOn ':launcher:shadowJar' archiveClassifier.set("") } +// Work around gradle shadow bug +// see https://github.com/johnrengelman/shadow/issues/713 +startScripts.dependsOn(':launcher:shadowJar') +distTar.dependsOn(':launcher:shadowJar') +distZip.dependsOn(':launcher:shadowJar') + build { dependsOn(shadowJar) }