Skip to content

Commit

Permalink
SKCraftGH-484 Work around bug with gradle shadow plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgehog1029 committed Aug 27, 2022
1 parent 9060af7 commit 13b6a77
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
28 changes: 28 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion creator-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
11 changes: 8 additions & 3 deletions launcher-builder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
9 changes: 8 additions & 1 deletion launcher-fancy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 13b6a77

Please sign in to comment.