Skip to content

Commit

Permalink
netty/shaded: Leverage shadow plugin's publishing support
Browse files Browse the repository at this point in the history
johnrengelman/shadow#543 fixed project support,
which means the workaround is no longer necessary.
  • Loading branch information
ejona86 committed Jun 7, 2021
1 parent 5001283 commit 1e9218f
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions netty/shaded/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,18 @@ shadowJar {
publishing {
publications {
maven(MavenPublication) {
// Ideally swap to project.shadow.component(it) when it isn't broken for project deps
artifact shadowJar
project.shadow.component(it)

// Empty jars are not published via withJavadocJar() and withSourcesJar()
artifact javadocJar
artifact sourcesJar

// shadow.component() is run after the main build.gradle's withXml
pom.withXml {
def dependencies = asNode().appendNode('dependencies')
project.configurations.shadow.allDependencies.each { dep ->
def dependencyNode = dependencies.appendNode('dependency')
dependencyNode.appendNode('groupId', dep.group)
dependencyNode.appendNode('artifactId', dep.name)
def version = (dep.name == 'grpc-core') ? '[' + dep.version + ']' : dep.version
dependencyNode.appendNode('version', version)
dependencyNode.appendNode('scope', 'compile')
asNode().dependencies.'*'.findAll() { dep ->
dep.artifactId.text() in ['grpc-api', 'grpc-core']
}.each() { core ->
core.version*.value = "[" + core.version.text() + "]"
}
}
}
Expand Down

0 comments on commit 1e9218f

Please sign in to comment.