netty/shaded: Leverage shadow plugin's publishing support

https://github.com/johnrengelman/shadow/pull/543 fixed project support,
which means the workaround is no longer necessary.
This commit is contained in:
Eric Anderson 2021-06-07 10:27:59 -07:00 committed by Eric Anderson
parent 91948b2606
commit 8360e60330
1 changed files with 7 additions and 10 deletions

View File

@ -47,21 +47,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() + "]"
}
}
}