Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve shadow jar building #961

Merged
merged 2 commits into from Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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