Skip to content

Commit 9520dc4

Browse files
authored
build.gradle: apply resolution strategy for runtimeClasspath
1 parent 83a3b25 commit 9520dc4

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

build.gradle

+13-7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ subprojects {
4141
}
4242
}
4343

44+
def isAndroid = project.name in [
45+
'grpc-android', 'grpc-android-interop-testing', 'grpc-cronet']
46+
4447
ext {
4548
def exeSuffix = osdetector.os == 'windows' ? ".exe" : ""
4649
protocPluginBaseName = 'protoc-gen-grpc-java'
@@ -54,7 +57,6 @@ subprojects {
5457
opencensusVersion = '0.24.0'
5558

5659
configureProtoCompilation = {
57-
boolean isAndroid = project.getName().contains('android')
5860
String generatedSourcePath = "${projectDir}/src/generated"
5961
project.protobuf {
6062
protoc {
@@ -187,16 +189,20 @@ subprojects {
187189
]
188190
}
189191

190-
// Define a separate configuration for managing the dependency on Jetty ALPN agent.
191192
configurations {
192-
compile {
193-
// Detect Maven Enforcer's dependencyConvergence failures. We only
194-
// care for artifacts used as libraries by others.
195-
if (!(project.name in [
193+
// Detect Maven Enforcer's dependencyConvergence failures. We only
194+
// care for artifacts used as libraries by others.
195+
if (isAndroid && !(project.name in ['grpc-android-interop-testing'])) {
196+
releaseRuntimeClasspath {
197+
resolutionStrategy.failOnVersionConflict()
198+
}
199+
}
200+
if (!isAndroid && !(project.name in [
196201
'grpc-benchmarks',
197202
'grpc-interop-testing',
198203
'grpc-gae-interop-testing-jdk8',
199-
])) {
204+
])) {
205+
runtimeClasspath {
200206
resolutionStrategy.failOnVersionConflict()
201207
}
202208
}

0 commit comments

Comments
 (0)