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

Shade io.netty package to avoid conflicts #19

Open
wants to merge 1 commit into
base: release/1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import java.time.Duration
import java.time.temporal.ChronoUnit
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.ShadowExtension

buildscript {

Expand All @@ -33,6 +35,7 @@ plugins {
id(Libs.nexus_publish_plugin_id) version Vers.nexus_publish_plugin apply false
id(Libs.nexus_staging_plugin_id) version Vers.nexus_staging_plugin
id(Libs.asciidoctor_plugin_id) version Vers.asciidoctor_plugin
id(Libs.shadow_plugin) version Vers.shadow_plugin
}

/**
Expand Down Expand Up @@ -138,6 +141,9 @@ subprojects {
}

create<MavenPublication>("maven") {
configure<ShadowExtension> {
component(this@create)
}
from(components["java"])

artifact(sourcesJar)
Expand Down Expand Up @@ -186,6 +192,17 @@ subprojects {
}

tasks {
withType<ShadowJar> {
relocate("io.netty", "ru.fix.shaded.armeria.io.netty")
isZip64 = true
mergeServiceFiles()
exclude("META-INF/*.SF")
exclude("META-INF/*.DSA")
exclude("META-INF/*.RSA")
exclude("LICENSE*")
classifier = null
}

withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
Expand All @@ -207,6 +224,7 @@ subprojects {
}
}
}
tasks.getByPath("build").dependsOn("shadowJar")
}

tasks {
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ object Vers {
const val asciidoctor_plugin = "1.5.9.2"
const val nexus_staging_plugin = "0.21.2"
const val nexus_publish_plugin = "0.4.0"
const val shadow_plugin = "6.1.0"

// Kotlin Dependencies
const val kotlin = "1.3.72"
Expand Down Expand Up @@ -40,6 +41,7 @@ object Libs {
const val asciidoctor_plugin = "org.asciidoctor:asciidoctor-gradle-plugin:${Vers.asciidoctor_plugin}"
const val nexus_staging_plugin_id = "io.codearte.nexus-staging"
const val nexus_publish_plugin_id = "de.marcphilipp.nexus-publish"
const val shadow_plugin = "com.github.johnrengelman.shadow"

// Kotlin
const val kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib:${Vers.kotlin}"
Expand Down
1 change: 1 addition & 0 deletions jfix-armeria-aggregating-profiler/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
kotlin("jvm")
id(Libs.shadow_plugin)
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions jfix-armeria-commons-testing/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
kotlin("jvm")
id(Libs.shadow_plugin)
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions jfix-armeria-commons/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
kotlin("jvm")
id(Libs.shadow_plugin)
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions jfix-armeria-dynamic-request/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
kotlin("jvm")
id(Libs.shadow_plugin)
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions jfix-armeria-facade-all-retrofit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import JFixArmeriaFacadeFeatures.*

plugins {
kotlin("jvm")
id(Libs.shadow_plugin)
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions jfix-armeria-facade-all/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import JFixArmeriaFacadeFeatures.*

plugins {
kotlin("jvm")
id(Libs.shadow_plugin)
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions jfix-armeria-facade/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import JFixArmeriaFacadeFeatures.*
plugins {
java
kotlin("jvm")
id(Libs.shadow_plugin)
}
java {
val main by sourceSets
Expand Down
1 change: 1 addition & 0 deletions jfix-armeria-limiter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
kotlin("jvm")
id(Libs.shadow_plugin)
}

dependencies {
Expand Down