Skip to content

Commit

Permalink
Remove semi-circular dependency between core and util
Browse files Browse the repository at this point in the history
Add the 'fake' dependency to grpc-netty instead of grpc-core.
grpc-okhttp already depends on grpc-util and probably would be fine
without round_robin on Android.

There's not actually a circular dependency, but some tools can't handle
the compile vs runtime distinction. Such tools are broken, but fixes
have been slow and this approach works with no real downfalls.

Works around #10576 #10701
  • Loading branch information
ejona86 committed Feb 16, 2024
1 parent 95b847e commit 1795348
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ description = 'gRPC: Core'
dependencies {
api project(':grpc-api')
// force dependent jars to depend on latest grpc-context
runtimeOnly project(":grpc-context"),
project(":grpc-util") // need grpc-util to pull in round robin
runtimeOnly project(":grpc-context")
implementation libraries.gson,
libraries.android.annotations,
libraries.animalsniffer.annotations,
Expand Down
1 change: 1 addition & 0 deletions netty/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies {
libraries.errorprone.annotations,
libraries.perfmark.api,
libraries.netty.unix.common
runtimeOnly project(":grpc-util") // need grpc-util to pull in round robin

// Tests depend on base class defined by core module.
testImplementation testFixtures(project(':grpc-core')),
Expand Down

0 comments on commit 1795348

Please sign in to comment.