Skip to content

Commit

Permalink
all: Fix opencensus-api dependency conflict (#7739)
Browse files Browse the repository at this point in the history
We depend on 0.28.0 while oauth2 depends on 0.24.0. This change replaces oauth2's opencensus-api dependency with our own.
  • Loading branch information
voidzcy committed Dec 21, 2020
1 parent 9085012 commit 0fb2667
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
7 changes: 1 addition & 6 deletions alts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
2 changes: 1 addition & 1 deletion interop-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0fb2667

Please sign in to comment.