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.protobuf,
libraries.conscrypt libraries.conscrypt
def nettyDependency = implementation project(':grpc-netty') def nettyDependency = implementation project(':grpc-netty')
implementation (libraries.google_auth_oauth2_http) { googleOauth2Dependency 'implementation'
// 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'
}
guavaDependency 'implementation' guavaDependency 'implementation'
compileOnly libraries.javax_annotation compileOnly libraries.javax_annotation

View File

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

View File

@ -239,6 +239,17 @@ subprojects {
guavaDependency 'runtimeOnly' 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 // A util function to config perfmark dependency with transitive
// dependencies properly resolved for the failOnVersionConflict strategy. // dependencies properly resolved for the failOnVersionConflict strategy.
perfmarkDependency = { configurationName -> perfmarkDependency = { configurationName ->

View File

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