Skip to content

Commit 78436fb

Browse files
committed
fix withXml
1 parent 91331a6 commit 78436fb

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bom/build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ gradle.projectsEvaluated {
1414
dependencies {
1515
constraints {
1616
projectsToInclude.each { api it }
17-
// compiler. should have "<type>pom</type>"
18-
// not sure how to express in gradle, patched in XML
19-
api "$project.group:protoc-gen-grpc-java:$project.version"
2017
}
2118
}
2219
}
@@ -26,9 +23,14 @@ publishing {
2623
maven(MavenPublication) {
2724
from components.javaPlatform
2825
pom.withXml {
29-
def lastDependency = asNode().dependencyManagement.dependencies.dependency.last()
30-
assert lastDependency.artifactId.text() == 'protoc-gen-grpc-java'
31-
lastDependency.appendNode('type', 'pom')
26+
def dependencies = asNode().dependencyManagement.dependencies.last()
27+
// add protoc gen (produced by grpc-compiler with different artifact name)
28+
// not sure how to express "<type>pom</type>" in gradle, kept in XML
29+
def dependencyNode = dependencies.appendNode('dependency')
30+
dependencyNode.appendNode('groupId', project.group)
31+
dependencyNode.appendNode('artifactId', 'protoc-gen-grpc-java')
32+
dependencyNode.appendNode('version', project.version)
33+
dependencyNode.appendNode('type', 'pom')
3234
}
3335
}
3436
}

0 commit comments

Comments
 (0)