Skip to content

Commit

Permalink
chore: improve shadow jar building (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
iProdigy committed Apr 6, 2024
1 parent 8c75c27 commit a07a9fa
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
14 changes: 12 additions & 2 deletions build.gradle.kts
Expand Up @@ -11,7 +11,7 @@ plugins {
id("io.freefair.lombok").version("8.6").apply(false)
id("com.coditory.manifest").version("0.2.6").apply(false)
id("me.champeau.jmh").version("0.7.2").apply(false)
id("com.github.johnrengelman.shadow").version("8.1.1").apply(false)
id("io.github.goooler.shadow").version("8.1.7").apply(false)
id("com.github.gmazzo.buildconfig").version("5.3.5").apply(false)
}

Expand Down Expand Up @@ -188,7 +188,17 @@ subprojects {
if (this is ShadowJar) {
archiveClassifier.set("shaded")
isEnableRelocation = true
relocationPrefix = "com.github.twitch4j.shaded.${"$version".replace(".", "_")}"
relocationPrefix = "com.github.twitch4j.shaded"

// support for multi-release jars since we depend upon jackson-core, which leverages FastDoubleParser
dependencies {
// https://github.com/johnrengelman/shadow/issues/729
exclude("META-INF/versions/**/module-info.class")
}
manifest {
// https://github.com/johnrengelman/shadow/issues/449
attributes("Multi-Release" to true)
}
}
if (enableManifest) {
manifest.from(File(buildDir, "resources/main/META-INF/MANIFEST.MF"))
Expand Down
2 changes: 1 addition & 1 deletion chat/build.gradle.kts
@@ -1,5 +1,5 @@
plugins {
id("com.github.johnrengelman.shadow")
id("io.github.goooler.shadow")
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion eventsub-websocket/build.gradle.kts
@@ -1,5 +1,5 @@
plugins {
id("com.github.johnrengelman.shadow")
id("io.github.goooler.shadow")
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion pubsub/build.gradle.kts
@@ -1,5 +1,5 @@
plugins {
id("com.github.johnrengelman.shadow")
id("io.github.goooler.shadow")
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion rest-helix/build.gradle.kts
@@ -1,5 +1,5 @@
plugins {
id("com.github.johnrengelman.shadow")
id("io.github.goooler.shadow")
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion twitch4j/build.gradle.kts
@@ -1,5 +1,5 @@
plugins {
id("com.github.johnrengelman.shadow")
id("io.github.goooler.shadow")
}

dependencies {
Expand Down

0 comments on commit a07a9fa

Please sign in to comment.