-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bom: format(tab->space) build.gradle
- Loading branch information
Showing
1 changed file
with
28 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
plugins { | ||
id "maven-publish" | ||
} | ||
|
||
description = 'gRPC: BOM' | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
// remove all other artifacts since BOM doesn't generates any Jar | ||
artifacts = [] | ||
publications { | ||
maven(MavenPublication) { | ||
// remove all other artifacts since BOM doesn't generates any Jar | ||
artifacts = [] | ||
|
||
pom.withXml { | ||
// Generate bom using subprojects | ||
def internalProjects = [project.name, 'grpc-xds', 'grpc-gae-interop-testing-jdk8', 'grpc-compiler'] | ||
pom.withXml { | ||
// Generate bom using subprojects | ||
def internalProjects = [project.name, 'grpc-xds', 'grpc-gae-interop-testing-jdk8', 'grpc-compiler'] | ||
|
||
def dependencyManagement = asNode().appendNode('dependencyManagement') | ||
def dependencies = dependencyManagement.appendNode('dependencies') | ||
rootProject.subprojects.each { subproject -> | ||
if (internalProjects.contains(subproject.name)) { | ||
return | ||
} | ||
def dependencyNode = dependencies.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', subproject.group) | ||
dependencyNode.appendNode('artifactId', subproject.name) | ||
dependencyNode.appendNode('version', subproject.version) | ||
} | ||
// add protoc gen (produced by grpc-compiler with different artifact name) | ||
def dependencyNode = dependencies.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', project.group) | ||
dependencyNode.appendNode('artifactId', 'protoc-gen-grpc-java') | ||
dependencyNode.appendNode('version', project.version) | ||
} | ||
def dependencyManagement = asNode().appendNode('dependencyManagement') | ||
def dependencies = dependencyManagement.appendNode('dependencies') | ||
rootProject.subprojects.each { subproject -> | ||
if (internalProjects.contains(subproject.name)) { | ||
return | ||
} | ||
def dependencyNode = dependencies.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', subproject.group) | ||
dependencyNode.appendNode('artifactId', subproject.name) | ||
dependencyNode.appendNode('version', subproject.version) | ||
} | ||
// add protoc gen (produced by grpc-compiler with different artifact name) | ||
def dependencyNode = dependencies.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', project.group) | ||
dependencyNode.appendNode('artifactId', 'protoc-gen-grpc-java') | ||
dependencyNode.appendNode('version', project.version) | ||
} | ||
} | ||
} | ||
} |