Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: migrate gradle build to java-library plugin #7001

Merged
merged 23 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3b866a0
context: migrate away deprecated gradle configurations
dapengzhang0 May 2, 2020
fba7883
all: use java-library gradle plugin for grpc-api
dapengzhang0 May 2, 2020
6bf2907
core,netty,okhttp: use java-library plugin for grpc-core
dapengzhang0 May 2, 2020
deefce4
stub: use java-library gradle plugin
dapengzhang0 May 3, 2020
1133620
compiler: migrate away deprecated gradle configurations
dapengzhang0 May 3, 2020
da0ac38
protobuf, protobuf-lite: use java-library gradle plugin
dapengzhang0 Apr 5, 2020
fb26a0a
auth: use java-library gradle plugin
dapengzhang0 Apr 5, 2020
0a31810
benchmarks: migrate away deprecated gradle configurations
dapengzhang0 Apr 5, 2020
3792677
all: use java-library gradle plugin for grpc-census
dapengzhang0 Apr 5, 2020
c0742cb
grpclb: migrate away deprecated gradle configurations
dapengzhang0 Apr 5, 2020
636bec2
netty: use java-library gradle plugin
dapengzhang0 Apr 6, 2020
d62f22f
okhttp: use java-library gradle plugin
dapengzhang0 Apr 6, 2020
521399e
rls: migrate away deprecated gradle configurations
dapengzhang0 Apr 6, 2020
acbff9e
services: use java-library gradle plugin
dapengzhang0 Apr 6, 2020
ef60e3b
xds: migrate away deprecated gradle configurations
dapengzhang0 Apr 6, 2020
a70e0b7
alts: use java-library gradle plugin
dapengzhang0 Apr 6, 2020
74f0aa9
testing,testing-proto: use java-library gradle plugin
dapengzhang0 Apr 6, 2020
7d1ae54
android,cronet: use api configuration with android library gradle plugin
dapengzhang0 Apr 6, 2020
1a988d3
interop-testing,gae-interop-testing: migrate away deprecated gradle c…
dapengzhang0 Apr 6, 2020
582b48c
grpc-all: migrate away deprecated gradle configurations
dapengzhang0 Apr 8, 2020
50fee92
cronet: remove redundant dep
dapengzhang0 May 4, 2020
694fe0d
gae-interop-testing: use junit instead of truth
dapengzhang0 May 4, 2020
a0c33c9
protobuf: leave comment 'Prefer our more up-to-date protobuf over 3.2…
dapengzhang0 May 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion all/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ for (subproject in rootProject.subprojects) {
}

dependencies {
compile subprojects.minus(project(':grpc-protobuf-lite'))
implementation subprojects.minus(project(':grpc-protobuf-lite'))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we should use api here. @ejona86 what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably better to use api to avoid breaking people. That said, I don't have too much sympathy for someone using grpc-all these days (vs early-on-pre-1.0 when it was used more heavily).

}

javadoc {
Expand Down
17 changes: 9 additions & 8 deletions alts/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "java"
id "java-library"
id "maven-publish"

id "com.github.johnrengelman.shadow"
Expand All @@ -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'
}
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 @@ -65,6 +65,7 @@ dependencies {
implementation (libraries.google_auth_oauth2_http) {
exclude group: 'org.apache.httpcomponents'
}
censusGrpcMetricDependency 'implementation'
dapengzhang0 marked this conversation as resolved.
Show resolved Hide resolved

compileOnly libraries.javax_annotation

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 5 additions & 7 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "java"
id "java-library"
id "maven-publish"

id "me.champeau.gradle.jmh"
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why expose this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is part of public API signature.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean annotations like @javax.annotation.concurrent.ThreadSafe, @javax.annotation.Nullable are part of some public API signature.

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
Expand Down
7 changes: 4 additions & 3 deletions auth/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "java"
id "java-library"
id "maven-publish"

id "me.champeau.gradle.japicmp"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ configurations {
}

dependencies {
compile project(':grpc-core'),
implementation project(':grpc-core'),
project(':grpc-netty'),
project(':grpc-okhttp'),
project(':grpc-stub'),
Expand All @@ -34,7 +34,7 @@ dependencies {
compileOnly libraries.javax_annotation
alpnagent libraries.jetty_alpn_agent

testCompile libraries.junit,
testImplementation libraries.junit,
libraries.mockito
}

Expand Down
12 changes: 6 additions & 6 deletions census/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "java"
id "java-library"
id "maven-publish"
}

Expand All @@ -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'),
Expand Down
6 changes: 3 additions & 3 deletions compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion context/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
14 changes: 8 additions & 6 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "java"
id "java-library"
id "maven-publish"

id "me.champeau.gradle.japicmp"
Expand All @@ -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'),
Expand Down
5 changes: 3 additions & 2 deletions cronet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ android {
}

dependencies {
implementation project(':grpc-core')
api project(':grpc-core'),
libraries.cronet_api
dapengzhang0 marked this conversation as resolved.
Show resolved Hide resolved
guavaDependency 'implementation'
testImplementation project(':grpc-testing')

implementation libraries.cronet_api
testImplementation libraries.cronet_embedded

testImplementation libraries.junit
Expand Down
17 changes: 8 additions & 9 deletions gae-interop-testing/gae-jdk8/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 5 additions & 3 deletions grpclb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
7 changes: 4 additions & 3 deletions interop-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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
}
Expand Down
14 changes: 8 additions & 6 deletions netty/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "java"
id "java-library"
id "maven-publish"

id "me.champeau.gradle.japicmp"
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions netty/shaded/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
14 changes: 7 additions & 7 deletions okhttp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "java"
id "java-library"
id "maven-publish"

id "me.champeau.gradle.japicmp"
Expand All @@ -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"
Expand Down
Loading