all: Fix opencensus-api dependency conflict (#7739)

We depend on 0.28.0 while oauth2 depends on 0.24.0. This change replaces oauth2's opencensus-api dependency with our own.
This commit is contained in:
Chengyuan Zhang 2020-12-21 12:02:17 -08:00 committed by GitHub
parent 90850128a6
commit 0fb2667c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 9 deletions

View File

@ -22,12 +22,7 @@ dependencies {
libraries.protobuf,
libraries.conscrypt
def nettyDependency = implementation project(':grpc-netty')
implementation (libraries.google_auth_oauth2_http) {
// prefer our own versions instead of google-auth-oauth2-http's dependency
exclude group: 'com.google.guava', module: 'guava'
// we'll always be more up-to-date
exclude group: 'io.grpc', module: 'grpc-context'
}
googleOauth2Dependency 'implementation'
guavaDependency 'implementation'
compileOnly libraries.javax_annotation

View File

@ -11,8 +11,8 @@ dependencies {
api project(':grpc-api'),
libraries.google_auth_credentials
guavaDependency 'implementation'
testImplementation project(':grpc-testing'),
libraries.google_auth_oauth2_http
testImplementation project(':grpc-testing')
googleOauth2Dependency 'testImplementation'
signature "org.codehaus.mojo.signature:java17:1.0@signature"
signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature"
}

View File

@ -239,6 +239,17 @@ subprojects {
guavaDependency 'runtimeOnly'
}
googleOauth2Dependency = { configurationName ->
dependencies."$configurationName"(libraries.google_auth_oauth2_http) {
exclude group: 'com.google.guava', module: 'guava'
exclude group: 'io.grpc', module: 'grpc-context'
exclude group: 'io.opencensus', module: 'opencensus-api'
}
dependencies.runtimeOnly project(':grpc-context')
censusApiDependency 'runtimeOnly'
guavaDependency 'runtimeOnly'
}
// A util function to config perfmark dependency with transitive
// dependencies properly resolved for the failOnVersionConflict strategy.
perfmarkDependency = { configurationName ->

View File

@ -27,10 +27,10 @@ dependencies {
project(':grpc-stub'),
project(':grpc-testing'),
project(path: ':grpc-xds', configuration: 'shadow'),
libraries.google_auth_oauth2_http,
libraries.junit,
libraries.truth
censusGrpcMetricDependency 'implementation'
googleOauth2Dependency 'implementation'
compileOnly libraries.javax_annotation
runtimeOnly libraries.opencensus_impl,
libraries.netty_tcnative,