mirror of https://github.com/grpc/grpc-java.git
39 lines
1.1 KiB
Groovy
39 lines
1.1 KiB
Groovy
plugins {
|
|
id 'java-platform'
|
|
id "maven-publish"
|
|
}
|
|
|
|
description = 'gRPC: BOM'
|
|
|
|
gradle.projectsEvaluated {
|
|
def projectsToInclude = rootProject.subprojects.findAll {
|
|
return it.name != 'grpc-compiler'
|
|
&& it.plugins.hasPlugin('java')
|
|
&& it.plugins.hasPlugin('maven-publish')
|
|
&& it.tasks.findByName('publishMavenPublicationToMavenRepository')?.enabled
|
|
}
|
|
dependencies {
|
|
constraints {
|
|
projectsToInclude.each { api it }
|
|
}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
from components.javaPlatform
|
|
pom.withXml {
|
|
def dependencies = asNode().dependencyManagement.dependencies.last()
|
|
// add protoc gen (produced by grpc-compiler with different artifact name)
|
|
// not sure how to express "<type>pom</type>" in gradle, kept in XML
|
|
def dependencyNode = dependencies.appendNode('dependency')
|
|
dependencyNode.appendNode('groupId', project.group)
|
|
dependencyNode.appendNode('artifactId', 'protoc-gen-grpc-java')
|
|
dependencyNode.appendNode('version', project.version)
|
|
dependencyNode.appendNode('type', 'pom')
|
|
}
|
|
}
|
|
}
|
|
}
|