Skip to content

Commit 121aa33

Browse files
authored
build: using external boms (#1172)
1 parent 4c6f32b commit 121aa33

File tree

1 file changed

+39
-23
lines changed

1 file changed

+39
-23
lines changed

build.gradle

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,18 @@ subprojects {
5353

5454
// ExpectedExceptionRefactoring and TestExceptionRefactoring suggest using
5555
// assertThrows, but assertThrows only works well with lambdas.
56-
it.options.errorprone.disable("ExpectedExceptionRefactoring") // "-Xep:ExpectedExceptionRefactoring:OFF"
56+
it.options.errorprone.disable("ExpectedExceptionRefactoring")
57+
// "-Xep:ExpectedExceptionRefactoring:OFF"
5758

5859
// AutoValueImmutableFields suggests returning Guava types from API methods
59-
it.options.errorprone.disable("AutoValueImmutableFields") // "-Xep:AutoValueImmutableFields:OFF"
60+
it.options.errorprone.disable("AutoValueImmutableFields")
61+
// "-Xep:AutoValueImmutableFields:OFF"
6062

6163
it.options.encoding = "UTF-8"
6264

6365
// Ignore warnings for protobuf and jmh generated files.
64-
it.options.errorprone.excludedPaths = ".*generated.*" // "-XepExcludedPaths:.*/build/generated/source/proto/.*"
66+
it.options.errorprone.excludedPaths = ".*generated.*"
67+
// "-XepExcludedPaths:.*/build/generated/source/proto/.*"
6568

6669
// Enforce errorprone warnings to be errors.
6770
if (!JavaVersion.current().isJava9() && !JavaVersion.current().isJava10() && !JavaVersion.current().isJava11()) {
@@ -98,43 +101,50 @@ subprojects {
98101
protocVersion = '3.11.4'
99102
zipkinReporterVersion = '2.12.2'
100103

104+
boms = [
105+
grpc : "io.grpc:grpc-bom:${grpcVersion}",
106+
guava : "com.google.guava:guava-bom:${guavaVersion}",
107+
protobuf : "com.google.protobuf:protobuf-bom:${protobufVersion}",
108+
zipkin_reporter: "io.zipkin.reporter2:zipkin-reporter-bom:${zipkinReporterVersion}"
109+
]
110+
101111
libraries = [
102112
auto_value : "com.google.auto.value:auto-value:${autoValueVersion}",
103113
auto_value_annotation : "com.google.auto.value:auto-value-annotations:${autoValueVersion}",
104114
disruptor : "com.lmax:disruptor:3.4.2",
105115
errorprone_annotation : "com.google.errorprone:error_prone_annotations:${errorProneVersion}",
106116
errorprone_core : "com.google.errorprone:error_prone_core:${errorProneVersion}",
107117
errorprone_javac : "com.google.errorprone:javac:${errorProneJavacVersion}",
108-
grpc_api : "io.grpc:grpc-api:${grpcVersion}",
109-
grpc_context : "io.grpc:grpc-context:${grpcVersion}",
110-
grpc_protobuf : "io.grpc:grpc-protobuf:${grpcVersion}",
111-
grpc_stub : "io.grpc:grpc-stub:${grpcVersion}",
112-
guava : "com.google.guava:guava:${guavaVersion}",
118+
grpc_api : "io.grpc:grpc-api",
119+
grpc_context : "io.grpc:grpc-context",
120+
grpc_protobuf : "io.grpc:grpc-protobuf",
121+
grpc_stub : "io.grpc:grpc-stub",
122+
guava : "com.google.guava:guava",
113123
javax_annotations : "javax.annotation:javax.annotation-api:1.3.2",
114124
jmh_core : "org.openjdk.jmh:jmh-core:${jmhVersion}",
115125
jmh_bytecode : "org.openjdk.jmh:jmh-generator-bytecode:${jmhVersion}",
116126
jsr305 : "com.google.code.findbugs:jsr305:${findBugsJsr305Version}",
117127
prometheus_client : "io.prometheus:simpleclient:${prometheusVersion}",
118128
prometheus_client_common: "io.prometheus:simpleclient_common:${prometheusVersion}",
119-
protobuf : "com.google.protobuf:protobuf-java:${protobufVersion}",
120-
protobuf_util : "com.google.protobuf:protobuf-java-util:${protobufVersion}",
121-
zipkin_reporter : "io.zipkin.reporter2:zipkin-reporter:${zipkinReporterVersion}",
122-
zipkin_urlconnection : "io.zipkin.reporter2:zipkin-sender-urlconnection:${zipkinReporterVersion}",
129+
protobuf : "com.google.protobuf:protobuf-java",
130+
protobuf_util : "com.google.protobuf:protobuf-java-util",
131+
zipkin_reporter : "io.zipkin.reporter2:zipkin-reporter",
132+
zipkin_urlconnection : "io.zipkin.reporter2:zipkin-sender-urlconnection",
123133

124134
// Compatibility layer
125-
opentracing : "io.opentracing:opentracing-api:${opentracingVersion}",
135+
opentracing : "io.opentracing:opentracing-api:${opentracingVersion}",
126136

127137
// Test dependencies.
128-
guava_testlib : "com.google.guava:guava-testlib:${guavaVersion}",
129-
junit : 'junit:junit:4.12',
130-
mockito : 'org.mockito:mockito-core:2.28.2',
131-
truth : 'com.google.truth:truth:1.0.1',
132-
system_rules : 'com.github.stefanbirkner:system-rules:1.19.0', // env and system properties
133-
slf4jsimple : 'org.slf4j:slf4j-simple:1.7.25', // Compatibility layer
134-
awaitility : 'org.awaitility:awaitility:3.0.0', // Compatibility layer
135-
testcontainers : 'org.testcontainers:testcontainers:1.13.0',
136-
rest_assured : 'io.rest-assured:rest-assured:4.2.0',
137-
jaeger_client : 'io.jaegertracing:jaeger-client:1.2.0' // Jaeger Client
138+
guava_testlib : "com.google.guava:guava-testlib",
139+
junit : 'junit:junit:4.12',
140+
mockito : 'org.mockito:mockito-core:2.28.2',
141+
truth : 'com.google.truth:truth:1.0.1',
142+
system_rules : 'com.github.stefanbirkner:system-rules:1.19.0', // env and system properties
143+
slf4jsimple : 'org.slf4j:slf4j-simple:1.7.25', // Compatibility layer
144+
awaitility : 'org.awaitility:awaitility:3.0.0', // Compatibility layer
145+
testcontainers : 'org.testcontainers:testcontainers:1.13.0',
146+
rest_assured : 'io.rest-assured:rest-assured:4.2.0',
147+
jaeger_client : 'io.jaegertracing:jaeger-client:1.2.0' // Jaeger Client
138148
]
139149
}
140150

@@ -161,6 +171,12 @@ subprojects {
161171
}
162172

163173
dependencies {
174+
175+
implementation platform(boms.grpc),
176+
platform(boms.guava),
177+
platform(boms.protobuf),
178+
platform(boms.zipkin_reporter)
179+
164180
compileOnly libraries.auto_value_annotation,
165181
libraries.errorprone_annotation,
166182
libraries.jsr305

0 commit comments

Comments
 (0)