From ef6b6169f80d14c35775a04daf9f375bd82ce2d4 Mon Sep 17 00:00:00 2001 From: Jihun Cho Date: Fri, 1 Feb 2019 14:00:05 -0800 Subject: [PATCH] Adding Bom (#5209) --- bom/build.gradle | 27 +++++++++++++++++++++++++++ build.gradle | 3 ++- examples/example-gauth/pom.xml | 22 +++++++++++++++------- examples/example-tls/pom.xml | 18 +++++++++++++++--- examples/pom.xml | 20 +++++++++++++++----- settings.gradle | 2 ++ 6 files changed, 76 insertions(+), 16 deletions(-) create mode 100644 bom/build.gradle diff --git a/bom/build.gradle b/bom/build.gradle new file mode 100644 index 0000000000..f074daea95 --- /dev/null +++ b/bom/build.gradle @@ -0,0 +1,27 @@ +description = 'gRPC: BOM' + +publishing { + 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'] + + 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) + } + } + } + } +} diff --git a/build.gradle b/build.gradle index c4848bbca9..f1f03bebbe 100644 --- a/build.gradle +++ b/build.gradle @@ -447,9 +447,10 @@ subprojects { // Run with: ./gradlew japicmp --continue def baselineGrpcVersion = '1.6.1' def publicApiSubprojects = [ - // TODO: uncomment after grpc-alts artifact is published. + // TODO: uncomment after grpc-alts, grpc-bom artifact is published. // ':grpc-alts', ':grpc-auth', + //':grpc-bom', ':grpc-context', ':grpc-core', ':grpc-grpclb', diff --git a/examples/example-gauth/pom.xml b/examples/example-gauth/pom.xml index d7dd791b16..56cefc29f7 100644 --- a/examples/example-gauth/pom.xml +++ b/examples/example-gauth/pom.xml @@ -9,37 +9,45 @@ 1.19.0-SNAPSHOT example-gauth https://github.com/grpc/grpc-java + UTF-8 1.19.0-SNAPSHOT - 3.5.1-1 3.5.1 - 2.0.20.Final 1.7 1.7 + + + + + io.grpc + grpc-bom + ${grpc.version} + pom + import + + + + io.grpc grpc-netty-shaded - ${grpc.version} runtime io.grpc grpc-protobuf - ${grpc.version} io.grpc grpc-stub - ${grpc.version} io.grpc grpc-auth - ${grpc.version} javax.annotation @@ -50,7 +58,6 @@ io.grpc grpc-testing - ${grpc.version} test @@ -81,6 +88,7 @@ test + diff --git a/examples/example-tls/pom.xml b/examples/example-tls/pom.xml index 021c4fba5c..d77818d3e5 100644 --- a/examples/example-tls/pom.xml +++ b/examples/example-tls/pom.xml @@ -9,6 +9,7 @@ 1.19.0-SNAPSHOT example-tls https://github.com/grpc/grpc-java + UTF-8 1.19.0-SNAPSHOT @@ -18,16 +19,27 @@ 1.7 1.7 + + + + + io.grpc + grpc-bom + ${grpc.version} + pom + import + + + + io.grpc grpc-protobuf - ${grpc.version} io.grpc grpc-stub - ${grpc.version} javax.annotation @@ -38,7 +50,6 @@ io.grpc grpc-netty - ${grpc.version} io.netty @@ -47,6 +58,7 @@ runtime + diff --git a/examples/pom.xml b/examples/pom.xml index 423794d8ff..67eac6f9f5 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -9,32 +9,42 @@ 1.19.0-SNAPSHOT examples https://github.com/grpc/grpc-java + UTF-8 1.19.0-SNAPSHOT 3.5.1 3.5.1-1 - 2.0.7.Final 1.7 1.7 + + + + + io.grpc + grpc-bom + ${grpc.version} + pom + import + + + + io.grpc grpc-netty-shaded - ${grpc.version} runtime io.grpc grpc-protobuf - ${grpc.version} io.grpc grpc-stub - ${grpc.version} javax.annotation @@ -45,7 +55,6 @@ io.grpc grpc-testing - ${grpc.version} test @@ -66,6 +75,7 @@ test + diff --git a/settings.gradle b/settings.gradle index 9663a3c195..9fc061ef58 100644 --- a/settings.gradle +++ b/settings.gradle @@ -19,6 +19,7 @@ include ":grpc-alts" include ":grpc-benchmarks" include ":grpc-services" include ":grpc-xds" +include ":grpc-bom" project(':grpc-core').projectDir = "$rootDir/core" as File project(':grpc-context').projectDir = "$rootDir/context" as File @@ -40,6 +41,7 @@ project(':grpc-alts').projectDir = "$rootDir/alts" as File project(':grpc-benchmarks').projectDir = "$rootDir/benchmarks" as File project(':grpc-services').projectDir = "$rootDir/services" as File project(':grpc-xds').projectDir = "$rootDir/xds" as File +project(':grpc-bom').projectDir = "$rootDir/bom" as File if (settings.hasProperty('skipCodegen') && skipCodegen.toBoolean()) { println '*** Skipping the build of codegen and compilation of proto files because skipCodegen=true'