Skip to content

Commit

Permalink
Change many api deps to implementation deps
Browse files Browse the repository at this point in the history
These look pretty fair now, mostly only exposing grpc-api and
annotations as api dependencies.
  • Loading branch information
ejona86 authored Dec 15, 2023
1 parent 8c4f4e0 commit d6830d7
Show file tree
Hide file tree
Showing 23 changed files with 41 additions and 14 deletions.
4 changes: 3 additions & 1 deletion alts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ plugins {
description = "gRPC: ALTS"

dependencies {
api project(':grpc-core')
api project(':grpc-api')
implementation project(':grpc-auth'),
project(':grpc-core'),
project(':grpc-grpclb'),
project(':grpc-protobuf'),
project(':grpc-stub'),
Expand All @@ -27,6 +28,7 @@ dependencies {

testImplementation project(':grpc-testing'),
testFixtures(project(':grpc-core')),
project(':grpc-inprocess'),
project(':grpc-testing-proto'),
libraries.guava,
libraries.junit,
Expand Down
1 change: 1 addition & 0 deletions android-interop-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ dependencies {
implementation 'com.google.android.gms:play-services-base:18.0.1'

implementation project(':grpc-android'),
project(':grpc-core'),
project(':grpc-auth'),
project(':grpc-census'),
project(':grpc-okhttp'),
Expand Down
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ repositories {
}

dependencies {
api project(':grpc-core')
api project(':grpc-api')
implementation project(':grpc-core')
implementation libraries.guava
testImplementation project('::grpc-okhttp')
testImplementation libraries.androidx.test.core
Expand Down
1 change: 1 addition & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
testFixturesImplementation libraries.guava,
libraries.junit,
libraries.mockito.core
testImplementation project(':grpc-core')
testImplementation project(':grpc-testing')
testImplementation libraries.guava.testlib

Expand Down
1 change: 1 addition & 0 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies {
libraries.google.auth.credentials
implementation libraries.guava
testImplementation project(':grpc-testing'),
project(':grpc-core'),
libraries.google.auth.oauth2Http
signature libraries.signature.java
signature libraries.signature.android
Expand Down
1 change: 1 addition & 0 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tasks.named("jar").configure {

dependencies {
implementation project(':grpc-core'),
project(':grpc-inprocess'),
project(':grpc-netty'),
project(':grpc-okhttp'),
project(':grpc-stub'),
Expand Down
4 changes: 3 additions & 1 deletion binder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ repositories {
}

dependencies {
api project(':grpc-core')
api project(':grpc-api')

implementation project(':grpc-core')
implementation libraries.androidx.annotation
implementation libraries.androidx.core
implementation libraries.androidx.lifecycle.common
Expand All @@ -51,6 +52,7 @@ dependencies {
testImplementation libraries.guava.testlib
testImplementation libraries.truth
testImplementation project(':grpc-testing')
testImplementation project(':grpc-inprocess')
testImplementation testFixtures(project(':grpc-core'))

androidTestAnnotationProcessor libraries.auto.value
Expand Down
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
libraries.truth,
project(':grpc-testing')
testImplementation testFixtures(project(':grpc-api')),
project(':grpc-inprocess'),
project(':grpc-testing')
testImplementation libraries.guava.testlib

Expand Down
3 changes: 2 additions & 1 deletion cronet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ android {
}

dependencies {
api project(':grpc-core'),
api project(':grpc-api'),
libraries.cronet.api
implementation project(':grpc-core')
implementation libraries.guava
testImplementation project(':grpc-testing')

Expand Down
1 change: 1 addition & 0 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}"

testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testImplementation "io.grpc:grpc-inprocess:${grpcVersion}"
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:4.4.0"
}
Expand Down
1 change: 1 addition & 0 deletions examples/example-hostname/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies {

testImplementation 'junit:junit:4.13.2'
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testImplementation "io.grpc:grpc-inprocess:${grpcVersion}"
}

protobuf {
Expand Down
1 change: 1 addition & 0 deletions examples/example-jwt-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {
runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}"

testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testImplementation "io.grpc:grpc-inprocess:${grpcVersion}"
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:4.4.0"
}
Expand Down
1 change: 1 addition & 0 deletions examples/example-oauth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {
runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}"

testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testImplementation "io.grpc:grpc-inprocess:${grpcVersion}"
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:4.4.0"
}
Expand Down
3 changes: 2 additions & 1 deletion inprocess/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ tasks.named("jar").configure {
}

dependencies {
api project(':grpc-core')
api project(':grpc-api')

implementation project(':grpc-core')
implementation libraries.guava
testImplementation project(':grpc-testing'),
testFixtures(project(':grpc-core'))
Expand Down
3 changes: 3 additions & 0 deletions interop-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies {
project(':grpc-rls'),
project(':grpc-services'),
project(':grpc-testing'),
project(':grpc-protobuf-lite'),
project(path: ':grpc-xds', configuration: 'shadow'),
libraries.hdrhistogram,
libraries.truth,
Expand All @@ -49,6 +50,8 @@ dependencies {
project(':grpc-rls')
testImplementation testFixtures(project(':grpc-api')),
testFixtures(project(':grpc-core')),
project(':grpc-inprocess'),
project(':grpc-core'),
libraries.mockito.core,
libraries.okhttp
alpnagent libraries.jetty.alpn.agent
Expand Down
5 changes: 3 additions & 2 deletions netty/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ tasks.named("jar").configure {
}

dependencies {
api project(':grpc-core'),
api project(':grpc-api'),
libraries.netty.codec.http2
implementation libs.netty.handler.proxy,
implementation project(':grpc-core'),
libs.netty.handler.proxy,
libraries.guava,
libraries.errorprone.annotations,
libraries.perfmark.api,
Expand Down
3 changes: 2 additions & 1 deletion okhttp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ tasks.named("jar").configure {
}

dependencies {
api project(':grpc-core')
api project(':grpc-api')
implementation project(':grpc-util'),
project(':grpc-core'),
libraries.okio,
libraries.guava,
libraries.perfmark.api
Expand Down
2 changes: 1 addition & 1 deletion protobuf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
exclude group: 'com.google.api', module: 'api-common'
}

api (project(':grpc-protobuf-lite')) {
implementation (project(':grpc-protobuf-lite')) {
exclude group: 'com.google.protobuf', module: 'protobuf-javalite'
}

Expand Down
1 change: 1 addition & 0 deletions rls/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies {
compileOnly libraries.javax.annotation
testImplementation libraries.truth,
project(':grpc-grpclb'),
project(':grpc-inprocess'),
project(':grpc-testing'),
project(':grpc-testing-proto'),
testFixtures(project(':grpc-core'))
Expand Down
7 changes: 4 additions & 3 deletions services/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ tasks.named("jar").configure {
}

dependencies {
api project(':grpc-protobuf'),
project(':grpc-stub'),
project(':grpc-util')
api project(':grpc-stub')
implementation project(':grpc-core'),
project(':grpc-protobuf'),
project(':grpc-util'),
libraries.protobuf.java.util,
libraries.guava.jre // JRE required by protobuf-java-util

Expand All @@ -35,6 +35,7 @@ dependencies {
libraries.gson // to fix checkUpperBoundDeps error here
compileOnly libraries.javax.annotation
testImplementation project(':grpc-testing'),
project(':grpc-inprocess'),
libraries.netty.transport.epoll, // for DomainSocketAddress
testFixtures(project(':grpc-core')),
testFixtures(project(':grpc-api'))
Expand Down
1 change: 1 addition & 0 deletions stub/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies {
libraries.guava
implementation libraries.errorprone.annotations
testImplementation libraries.truth,
project(':grpc-inprocess'),
project(':grpc-testing'),
testFixtures(project(':grpc-api'))
signature libraries.signature.java
Expand Down
5 changes: 3 additions & 2 deletions testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ plugins {
description = "gRPC: Testing"

dependencies {
api project(':grpc-inprocess'),
project(':grpc-util'),
api project(':grpc-util'),
project(':grpc-stub'),
libraries.junit
implementation project(':grpc-inprocess')
implementation project(':grpc-core')
// Only io.grpc.internal.testing.StatsTestUtils depends on opencensus_api, for internal use.
compileOnly libraries.opencensus.api
runtimeOnly project(":grpc-api") // Pull in newer version than census-api
Expand Down
2 changes: 2 additions & 0 deletions xds/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies {
compileOnly sourceSets.thirdparty.output
implementation project(':grpc-stub'),
project(':grpc-core'),
project(':grpc-util'),
project(':grpc-services'),
project(':grpc-auth'),
project(path: ':grpc-alts', configuration: 'shadow'),
Expand All @@ -58,6 +59,7 @@ dependencies {
def nettyDependency = implementation project(':grpc-netty')

testImplementation project(':grpc-rls')
testImplementation project(':grpc-inprocess')
testImplementation testFixtures(project(':grpc-core')),
testFixtures(project(':grpc-api')),
testFixtures(project(':grpc-util'))
Expand Down

0 comments on commit d6830d7

Please sign in to comment.