diff --git a/all/build.gradle b/all/build.gradle index 9b7a9825666..ffba5f508e2 100644 --- a/all/build.gradle +++ b/all/build.gradle @@ -31,7 +31,7 @@ for (subproject in rootProject.subprojects) { } dependencies { - compile subprojects.minus(project(':grpc-protobuf-lite')) + implementation subprojects.minus(project(':grpc-protobuf-lite')) } javadoc { diff --git a/alts/build.gradle b/alts/build.gradle index 9796ada6abc..60f8fe1ed23 100644 --- a/alts/build.gradle +++ b/alts/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "com.github.johnrengelman.shadow" @@ -13,34 +13,35 @@ sourceCompatibility = 1.7 targetCompatibility = 1.7 dependencies { - compile project(':grpc-auth'), - project(':grpc-core'), + api project(':grpc-core') + implementation project(':grpc-auth'), project(':grpc-grpclb'), project(':grpc-protobuf'), project(':grpc-stub'), libraries.lang, libraries.protobuf, libraries.conscrypt - def nettyDependency = compile project(':grpc-netty') - compile (libraries.google_auth_oauth2_http) { + 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' } + guavaDependency 'implementation' compileOnly libraries.javax_annotation - shadow configurations.compile.getDependencies().minus(nettyDependency) + shadow configurations.implementation.getDependencies().minus(nettyDependency) shadow project(path: ':grpc-netty-shaded', configuration: 'shadow') - testCompile project(':grpc-testing'), + testImplementation project(':grpc-testing'), project(':grpc-testing-proto'), libraries.guava, libraries.guava_testlib, libraries.junit, libraries.mockito, libraries.truth - testRuntime libraries.netty_tcnative, + testRuntimeOnly libraries.netty_tcnative, libraries.netty_epoll signature 'org.codehaus.mojo.signature:java17:1.0@signature' } diff --git a/android-interop-testing/build.gradle b/android-interop-testing/build.gradle index 36d3d21d53b..ec144bda19a 100644 --- a/android-interop-testing/build.gradle +++ b/android-interop-testing/build.gradle @@ -65,6 +65,7 @@ dependencies { implementation (libraries.google_auth_oauth2_http) { exclude group: 'org.apache.httpcomponents' } + censusGrpcMetricDependency 'implementation' compileOnly libraries.javax_annotation diff --git a/android/build.gradle b/android/build.gradle index 83dfc39fb80..97f24cd92c1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -26,8 +26,8 @@ repositories { } dependencies { - implementation project(':grpc-core') - + api project(':grpc-core') + guavaDependency 'implementation' testImplementation project('::grpc-okhttp') testImplementation libraries.androidx_test testImplementation libraries.junit diff --git a/api/build.gradle b/api/build.gradle index 6ffb2036898..3eaab4894f4 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "me.champeau.gradle.jmh" @@ -11,13 +11,11 @@ description = 'gRPC: API' evaluationDependsOn(project(':grpc-context').path) dependencies { - compile project(':grpc-context'), - libraries.errorprone, - libraries.jsr305, - libraries.animalsniffer_annotations - guavaDependency 'compile' + api project(':grpc-context'), + libraries.jsr305 + guavaDependency 'implementation' - testCompile project(':grpc-context').sourceSets.test.output, + testImplementation project(':grpc-context').sourceSets.test.output, project(':grpc-testing'), project(':grpc-grpclb'), libraries.guava_testlib diff --git a/auth/build.gradle b/auth/build.gradle index 2dafc0f4fd9..b2e1620bb68 100644 --- a/auth/build.gradle +++ b/auth/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "me.champeau.gradle.japicmp" @@ -8,9 +8,10 @@ plugins { description = "gRPC: Auth" dependencies { - compile project(':grpc-api'), + api project(':grpc-api'), libraries.google_auth_credentials - testCompile project(':grpc-testing'), + guavaDependency 'implementation' + testImplementation project(':grpc-testing'), libraries.google_auth_oauth2_http signature "org.codehaus.mojo.signature:java17:1.0@signature" signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature" diff --git a/benchmarks/build.gradle b/benchmarks/build.gradle index 7bf6336325b..c59ef8e7039 100644 --- a/benchmarks/build.gradle +++ b/benchmarks/build.gradle @@ -21,7 +21,7 @@ configurations { } dependencies { - compile project(':grpc-core'), + implementation project(':grpc-core'), project(':grpc-netty'), project(':grpc-okhttp'), project(':grpc-stub'), @@ -34,7 +34,7 @@ dependencies { compileOnly libraries.javax_annotation alpnagent libraries.jetty_alpn_agent - testCompile libraries.junit, + testImplementation libraries.junit, libraries.mockito } diff --git a/census/build.gradle b/census/build.gradle index d3f359a756e..7925262ce3c 100644 --- a/census/build.gradle +++ b/census/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" } @@ -8,12 +8,12 @@ description = 'gRPC: Census' evaluationDependsOn(project(':grpc-api').path) dependencies { - compile project(':grpc-api') + api project(':grpc-api') + guavaDependency 'implementation' + censusApiDependency 'implementation' + censusGrpcMetricDependency 'implementation' - censusApiDependency 'compile' - censusGrpcMetricDependency 'compile' - - testCompile project(':grpc-api').sourceSets.test.output, + testImplementation project(':grpc-api').sourceSets.test.output, project(':grpc-context').sourceSets.test.output, project(':grpc-core').sourceSets.test.output, project(':grpc-testing'), diff --git a/compiler/build.gradle b/compiler/build.gradle index 098f48c3080..60d3a436f6c 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -126,14 +126,14 @@ model { } configurations { - testLiteCompile + testLiteImplementation } dependencies { - testCompile project(':grpc-protobuf'), + testImplementation project(':grpc-protobuf'), project(':grpc-stub'), libraries.javax_annotation - testLiteCompile project(':grpc-protobuf-lite'), + testLiteImplementation project(':grpc-protobuf-lite'), project(':grpc-stub'), libraries.javax_annotation } diff --git a/context/build.gradle b/context/build.gradle index 832e22accba..1028ad2c628 100644 --- a/context/build.gradle +++ b/context/build.gradle @@ -10,7 +10,7 @@ plugins { description = 'gRPC: Context' dependencies { - testCompile libraries.jsr305, libraries.guava_testlib + testImplementation libraries.jsr305, libraries.guava_testlib signature "org.codehaus.mojo.signature:java17:1.0@signature" signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature" } diff --git a/core/build.gradle b/core/build.gradle index 3a229c0020e..50fc7a282bb 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "me.champeau.gradle.japicmp" @@ -13,12 +13,14 @@ evaluationDependsOn(project(':grpc-context').path) evaluationDependsOn(project(':grpc-api').path) dependencies { - compile project(':grpc-api'), - libraries.gson, + api project(':grpc-api') + implementation libraries.gson, libraries.android_annotations, - libraries.errorprone // prefer our version to perfmark's 2.3.3 - perfmarkDependency 'compile' - testCompile project(':grpc-context').sourceSets.test.output, + libraries.animalsniffer_annotations, + libraries.errorprone + guavaDependency 'implementation' + perfmarkDependency 'implementation' + testImplementation project(':grpc-context').sourceSets.test.output, project(':grpc-api').sourceSets.test.output, project(':grpc-testing'), project(':grpc-grpclb'), diff --git a/cronet/build.gradle b/cronet/build.gradle index aac89f07614..b1b65685bb2 100644 --- a/cronet/build.gradle +++ b/cronet/build.gradle @@ -33,10 +33,11 @@ android { } dependencies { - implementation project(':grpc-core') + api project(':grpc-core'), + libraries.cronet_api + guavaDependency 'implementation' testImplementation project(':grpc-testing') - implementation libraries.cronet_api testImplementation libraries.cronet_embedded testImplementation libraries.junit diff --git a/gae-interop-testing/gae-jdk8/build.gradle b/gae-interop-testing/gae-jdk8/build.gradle index 1ef4086dcc5..58d6ab78d32 100644 --- a/gae-interop-testing/gae-jdk8/build.gradle +++ b/gae-interop-testing/gae-jdk8/build.gradle @@ -44,16 +44,15 @@ apply plugin: 'com.google.cloud.tools.appengine' // App Engine tasks dependencies { providedCompile group: 'javax.servlet', name: 'servlet-api', version:'2.5' - compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.59' - // Deps needed by all gRPC apps in GAE - compile libraries.google_api_protos - compile project(":grpc-okhttp") - compile project(":grpc-protobuf") - compile project(":grpc-stub") - compile (project(":grpc-interop-testing")) { - exclude group: "io.grpc", module: "grpc-netty-shaded" + runtimeOnly 'com.google.appengine:appengine-api-1.0-sdk:1.9.59' + implementation project(':grpc-netty') + implementation project(":grpc-stub") + implementation (project(':grpc-interop-testing')) { + exclude group: 'io.grpc', module: 'grpc-alts' } - compile libraries.netty_tcnative + implementation libraries.junit + implementation libraries.protobuf + runtimeOnly libraries.netty_tcnative } compileJava { diff --git a/grpclb/build.gradle b/grpclb/build.gradle index 1fd118c878f..973770feb2f 100644 --- a/grpclb/build.gradle +++ b/grpclb/build.gradle @@ -11,17 +11,19 @@ description = "gRPC: GRPCLB LoadBalancer plugin" evaluationDependsOn(project(':grpc-core').path) dependencies { - compile project(':grpc-core'), + implementation project(':grpc-core'), project(':grpc-protobuf'), project(':grpc-stub'), libraries.protobuf - compile (libraries.protobuf_util) { + implementation (libraries.protobuf_util) { // prefer our own versions instead of protobuf-util's dependency exclude group: 'com.google.guava', module: 'guava' exclude group: 'com.google.errorprone', module: 'error_prone_annotations' } + guavaDependency 'implementation' + runtimeOnly libraries.errorprone compileOnly libraries.javax_annotation - testCompile libraries.truth, + testImplementation libraries.truth, project(':grpc-core').sourceSets.test.output } diff --git a/interop-testing/build.gradle b/interop-testing/build.gradle index 30ece36169f..9032e4f7646 100644 --- a/interop-testing/build.gradle +++ b/interop-testing/build.gradle @@ -17,7 +17,7 @@ configurations { evaluationDependsOn(project(':grpc-context').path) dependencies { - compile project(path: ':grpc-alts', configuration: 'shadow'), + implementation project(path: ':grpc-alts', configuration: 'shadow'), project(':grpc-auth'), project(':grpc-census'), project(':grpc-core'), @@ -30,12 +30,13 @@ dependencies { libraries.google_auth_oauth2_http, libraries.junit, libraries.truth + censusGrpcMetricDependency 'implementation' compileOnly libraries.javax_annotation - runtime libraries.opencensus_impl, + runtimeOnly libraries.opencensus_impl, libraries.netty_tcnative, project(':grpc-grpclb') xdsRuntime project(path: ':grpc-xds', configuration: 'shadow') - testCompile project(':grpc-context').sourceSets.test.output, + testImplementation project(':grpc-context').sourceSets.test.output, libraries.mockito alpnagent libraries.jetty_alpn_agent } diff --git a/netty/build.gradle b/netty/build.gradle index c895a682a71..629dc823b3b 100644 --- a/netty/build.gradle +++ b/netty/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "me.champeau.gradle.japicmp" @@ -16,15 +16,17 @@ configurations { evaluationDependsOn(project(':grpc-core').path) dependencies { - compile project(':grpc-core'), - libraries.netty, - libraries.netty_proxy_handler + api project(':grpc-core'), + libraries.netty + implementation libraries.netty_proxy_handler + guavaDependency 'implementation' + perfmarkDependency 'implementation' // Tests depend on base class defined by core module. - testCompile project(':grpc-core').sourceSets.test.output, + testImplementation project(':grpc-core').sourceSets.test.output, project(':grpc-testing'), project(':grpc-testing-proto') - testRuntime libraries.netty_tcnative, + testRuntimeOnly libraries.netty_tcnative, libraries.conscrypt, libraries.netty_epoll signature "org.codehaus.mojo.signature:java17:1.0@signature" diff --git a/netty/shaded/build.gradle b/netty/shaded/build.gradle index 1ecc36d9708..904bccd44df 100644 --- a/netty/shaded/build.gradle +++ b/netty/shaded/build.gradle @@ -10,10 +10,10 @@ description = "gRPC: Netty Shaded" sourceSets { testShadow {} } dependencies { - compile project(':grpc-netty') - runtime libraries.netty_tcnative, + implementation project(':grpc-netty') + runtimeOnly libraries.netty_tcnative, libraries.netty_epoll - testShadowCompile files(shadowJar), + testShadowImplementation files(shadowJar), configurations.shadow, project(':grpc-testing-proto'), project(':grpc-testing'), diff --git a/okhttp/build.gradle b/okhttp/build.gradle index b594600c2d5..0c23c3b9f80 100644 --- a/okhttp/build.gradle +++ b/okhttp/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "me.champeau.gradle.japicmp" @@ -11,16 +11,16 @@ description = "gRPC: OkHttp" evaluationDependsOn(project(':grpc-core').path) dependencies { - compile project(':grpc-core'), - libraries.okio - - compile (libraries.okhttp) { + api project(':grpc-core') + api (libraries.okhttp) { // prefer our own versions instead of okhttp's dependency exclude group: 'com.squareup.okio', module: 'okio' } - + implementation libraries.okio + guavaDependency 'implementation' + perfmarkDependency 'implementation' // Tests depend on base class defined by core module. - testCompile project(':grpc-core').sourceSets.test.output, + testImplementation project(':grpc-core').sourceSets.test.output, project(':grpc-testing'), project(':grpc-netty') signature "org.codehaus.mojo.signature:java17:1.0@signature" diff --git a/protobuf-lite/build.gradle b/protobuf-lite/build.gradle index 341348929d6..000d8c721e0 100644 --- a/protobuf-lite/build.gradle +++ b/protobuf-lite/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "com.google.protobuf" @@ -10,11 +10,12 @@ plugins { description = 'gRPC: Protobuf Lite' dependencies { - compile project(':grpc-api'), + api project(':grpc-api'), libraries.protobuf_lite - guavaDependency 'compile' + implementation libraries.jsr305 + guavaDependency 'implementation' - testCompile project(':grpc-core') + testImplementation project(':grpc-core') signature "org.codehaus.mojo.signature:java17:1.0@signature" signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature" diff --git a/protobuf/build.gradle b/protobuf/build.gradle index 2e0e7727ee0..af7f51c836e 100644 --- a/protobuf/build.gradle +++ b/protobuf/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "com.google.protobuf" @@ -10,11 +10,12 @@ plugins { description = 'gRPC: Protobuf' dependencies { - compile project(':grpc-api'), + api project(':grpc-api'), + libraries.jsr305, libraries.protobuf - guavaDependency 'compile' + guavaDependency 'implementation' - compile (libraries.google_api_protos) { + api (libraries.google_api_protos) { // 'com.google.api:api-common' transitively depends on auto-value, which breaks our // annotations. exclude group: 'com.google.api', module: 'api-common' @@ -22,7 +23,7 @@ dependencies { exclude group: 'com.google.protobuf', module: 'protobuf-java' } - compile (project(':grpc-protobuf-lite')) { + api (project(':grpc-protobuf-lite')) { exclude group: 'com.google.protobuf', module: 'protobuf-javalite' } diff --git a/rls/build.gradle b/rls/build.gradle index 549d43c0322..e5ff9c4fdca 100644 --- a/rls/build.gradle +++ b/rls/build.gradle @@ -13,7 +13,7 @@ dependencies { project(':grpc-protobuf'), project(':grpc-stub') compileOnly libraries.javax_annotation - testCompile libraries.truth, + testImplementation libraries.truth, project(':grpc-testing'), project(':grpc-testing-proto'), project(':grpc-core').sourceSets.test.output // for FakeClock diff --git a/services/build.gradle b/services/build.gradle index 5a759844352..f5132515528 100644 --- a/services/build.gradle +++ b/services/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "com.google.protobuf" @@ -19,17 +19,19 @@ description = "gRPC: Services" evaluationDependsOn(project(':grpc-core').path) dependencies { - compile project(':grpc-protobuf'), + api project(':grpc-protobuf'), project(':grpc-stub'), project(':grpc-core') - compile (libraries.protobuf_util) { + implementation (libraries.protobuf_util) { // prefer our own versions instead of protobuf-util's dependency exclude group: 'com.google.guava', module: 'guava' exclude group: 'com.google.errorprone', module: 'error_prone_annotations' } + guavaDependency 'implementation' + runtimeOnly libraries.errorprone compileOnly libraries.javax_annotation - testCompile project(':grpc-testing'), + testImplementation project(':grpc-testing'), libraries.netty_epoll, // for DomainSocketAddress project(':grpc-core').sourceSets.test.output // for FakeClock testCompileOnly libraries.javax_annotation diff --git a/stub/build.gradle b/stub/build.gradle index 2b7c82e5bfc..a2726d0ad63 100644 --- a/stub/build.gradle +++ b/stub/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "me.champeau.gradle.japicmp" @@ -8,8 +8,9 @@ plugins { description = "gRPC: Stub" dependencies { - compile project(':grpc-api') - testCompile libraries.truth, + api project(':grpc-api') + guavaDependency 'api' + testImplementation libraries.truth, project(':grpc-testing') signature "org.codehaus.mojo.signature:java17:1.0@signature" signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature" diff --git a/testing-proto/build.gradle b/testing-proto/build.gradle index 8ff8ccc6c0e..145ded4ef11 100644 --- a/testing-proto/build.gradle +++ b/testing-proto/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "com.google.protobuf" @@ -8,10 +8,10 @@ plugins { description = "gRPC: Testing Protos" dependencies { - compile project(':grpc-protobuf'), + api project(':grpc-protobuf'), project(':grpc-stub') compileOnly libraries.javax_annotation - testCompile libraries.truth + testImplementation libraries.truth testRuntime libraries.javax_annotation } diff --git a/testing/build.gradle b/testing/build.gradle index 7f79652e361..dc619913b6b 100644 --- a/testing/build.gradle +++ b/testing/build.gradle @@ -1,5 +1,5 @@ plugins { - id "java" + id "java-library" id "maven-publish" id "me.champeau.gradle.japicmp" @@ -10,18 +10,18 @@ description = "gRPC: Testing" evaluationDependsOn(project(':grpc-core').path) dependencies { - compile project(':grpc-core'), + api project(':grpc-core'), project(':grpc-stub'), libraries.junit - censusApiDependency 'compile' + censusApiDependency 'implementation' - testCompile (libraries.mockito) { + testImplementation (libraries.mockito) { // prefer our own versions instead of mockito's dependency exclude group: 'org.hamcrest', module: 'hamcrest-core' } - testCompile project(':grpc-testing-proto'), + testImplementation project(':grpc-testing-proto'), project(':grpc-core').sourceSets.test.output } diff --git a/xds/build.gradle b/xds/build.gradle index f71fb3f3944..d594b2e9d0d 100644 --- a/xds/build.gradle +++ b/xds/build.gradle @@ -19,42 +19,42 @@ description = "gRPC: XDS plugin" evaluationDependsOn(project(':grpc-core').path) dependencies { - compile project(':grpc-protobuf'), + implementation project(':grpc-protobuf'), project(':grpc-stub'), project(':grpc-core'), project(':grpc-services'), project(path: ':grpc-alts', configuration: 'shadow'), libraries.gson - def nettyDependency = compile project(':grpc-netty') + def nettyDependency = implementation project(':grpc-netty') - compile (libraries.opencensus_proto) { + implementation (libraries.opencensus_proto) { // prefer our own versions instead of opencensus_proto's exclude group: 'com.google.protobuf', module: 'protobuf-java' exclude group: 'io.grpc', module: 'grpc-protobuf' exclude group: 'io.grpc', module: 'grpc-stub' } - compile (libraries.protobuf_util) { + implementation (libraries.protobuf_util) { // prefer our own versions instead of protobuf-util's dependency exclude group: 'com.google.guava', module: 'guava' exclude group: 'com.google.errorprone', module: 'error_prone_annotations' } - testCompile project(':grpc-core').sourceSets.test.output + testImplementation project(':grpc-core').sourceSets.test.output compileOnly libraries.javax_annotation, // At runtime use the epoll included in grpc-netty-shaded libraries.netty_epoll - - testCompile project(':grpc-testing'), + + testImplementation project(':grpc-testing'), project(':grpc-testing-proto'), libraries.guava_testlib, libraries.netty_epoll - shadow configurations.compile.getDependencies().minus([nettyDependency]) + shadow configurations.implementation.getDependencies().minus([nettyDependency]) shadow project(path: ':grpc-netty-shaded', configuration: 'shadow') signature "org.codehaus.mojo.signature:java17:1.0@signature" - testRuntime libraries.netty_tcnative + testRuntimeOnly libraries.netty_tcnative } sourceSets {