Skip to content

Commit

Permalink
Bump to Gradle 6.9 and update plugins
Browse files Browse the repository at this point in the history
These changes make the build compatible with Gradle 7, except for
Android which requires plugin updates.

I removed animalsniffer from binder because it did nothing (as there
were no signatures) and it was failing after setting toolVersion. It
failed because animalsniffer is only compatible with java plugin. After
this change I put the withId(animalsniffer) loading inside the
withId(java) to avoid a plugin ordering failure. That made it safe again
for binder to load animalsniffer, but it is still best to remove the
plugin from binder as it is misleading.

I did not upgrade Android plugin versions as newer versions (even 3.6)
require dealing with androidx (#8421).
  • Loading branch information
ejona86 committed Jan 7, 2022
1 parent 5ae6f9c commit d44de50
Show file tree
Hide file tree
Showing 22 changed files with 89 additions and 84 deletions.
4 changes: 2 additions & 2 deletions all/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ task jacocoMerge(type: JacocoMerge) {
jacocoTestReport {
dependsOn(jacocoMerge)
reports {
xml.enabled = true
html.enabled = true
xml.required = true
html.required = true
}

subprojects.each { subproject ->
Expand Down
2 changes: 1 addition & 1 deletion api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "java-library"
id "maven-publish"

id "me.champeau.gradle.jmh"
id "me.champeau.jmh"
id "ru.vyarus.animalsniffer"
}

Expand Down
12 changes: 6 additions & 6 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id "maven-publish"

id "com.google.protobuf"
id "me.champeau.gradle.jmh"
id "me.champeau.jmh"
}

description = "grpc Benchmarks"
Expand All @@ -13,7 +13,7 @@ startScripts.enabled = false
run.enabled = false

jmh {
jvmArgs = "-server -Xms2g -Xmx2g"
jvmArgs = ["-server", "-Xms2g", "-Xmx2g"]
}

configurations {
Expand Down Expand Up @@ -55,30 +55,30 @@ def vmArgs = [
]

task qps_client(type: CreateStartScripts) {
mainClassName = "io.grpc.benchmarks.qps.AsyncClient"
mainClass = "io.grpc.benchmarks.qps.AsyncClient"
applicationName = "qps_client"
defaultJvmOpts = vmArgs
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task openloop_client(type: CreateStartScripts) {
mainClassName = "io.grpc.benchmarks.qps.OpenLoopClient"
mainClass = "io.grpc.benchmarks.qps.OpenLoopClient"
applicationName = "openloop_client"
defaultJvmOpts = vmArgs
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task qps_server(type: CreateStartScripts) {
mainClassName = "io.grpc.benchmarks.qps.AsyncServer"
mainClass = "io.grpc.benchmarks.qps.AsyncServer"
applicationName = "qps_server"
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task benchmark_worker(type: CreateStartScripts) {
mainClassName = "io.grpc.benchmarks.driver.LoadWorker"
mainClass = "io.grpc.benchmarks.driver.LoadWorker"
applicationName = "benchmark_worker"
defaultJvmOpts = vmArgs
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
Expand Down
1 change: 0 additions & 1 deletion binder/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id "maven-publish"
id "com.android.library"
id "ru.vyarus.animalsniffer"
id "digital.wup.android-maven-publish"
}

Expand Down
20 changes: 13 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ subprojects {
}
}

jacoco { toolVersion = "0.8.2" }

checkstyle {
configDirectory = file("$rootDir/buildscripts")
toolVersion = "6.17"
Expand Down Expand Up @@ -320,6 +318,14 @@ subprojects {
options.errorprone.check("UnnecessaryAnonymousClass", CheckSeverity.OFF)
options.errorprone.check("PreferJavaTimeOverload", CheckSeverity.OFF)
}

plugins.withId("ru.vyarus.animalsniffer") {
// Only available after java plugin has loaded
animalsniffer {
// Breaks on upgrade: https://github.com/mojohaus/animal-sniffer/issues/131
toolVersion = '1.18'
}
}
}

plugins.withId("java-library") {
Expand All @@ -335,13 +341,13 @@ subprojects {
}
}

plugins.withId("me.champeau.gradle.jmh") {
dependencies {
jmh 'org.openjdk.jmh:jmh-core:1.19',
'org.openjdk.jmh:jmh-generator-bytecode:1.19'
}
plugins.withId("me.champeau.jmh") {
// invoke jmh on a single benchmark class like so:
// ./gradlew -PjmhIncludeSingleClass=StatsTraceContextBenchmark clean :grpc-core:jmh
compileJmhJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
jmh {
warmupIterations = 10
iterations = 10
Expand Down
2 changes: 1 addition & 1 deletion context/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id "maven-publish"

id "me.champeau.gradle.japicmp"
id "me.champeau.gradle.jmh"
id "me.champeau.jmh"
id "ru.vyarus.animalsniffer"
}

Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
id "maven-publish"

id "me.champeau.gradle.japicmp"
id "me.champeau.gradle.jmh"
id "me.champeau.jmh"
id "ru.vyarus.animalsniffer"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/android/clientcache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.17"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.18"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion examples/android/helloworld/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.17"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.18"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion examples/android/routeguide/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.17"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.18"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion examples/android/strictmode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.17"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.18"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
46 changes: 23 additions & 23 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
// Provide convenience executables for trying out the examples.
id 'application'
// ASSUMES GRADLE 5.6 OR HIGHER. Use plugin version 0.8.10 with earlier gradle versions
id 'com.google.protobuf' version '0.8.17'
id 'com.google.protobuf' version '0.8.18'
// Generate IntelliJ IDEA's .idea & .iml project files
id 'idea'
}
Expand Down Expand Up @@ -64,79 +64,79 @@ sourceSets {
startScripts.enabled = false

task routeGuideServer(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.routeguide.RouteGuideServer'
mainClass = 'io.grpc.examples.routeguide.RouteGuideServer'
applicationName = 'route-guide-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task routeGuideClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.routeguide.RouteGuideClient'
mainClass = 'io.grpc.examples.routeguide.RouteGuideClient'
applicationName = 'route-guide-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task helloWorldServer(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.helloworld.HelloWorldServer'
mainClass = 'io.grpc.examples.helloworld.HelloWorldServer'
applicationName = 'hello-world-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task helloWorldClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.helloworld.HelloWorldClient'
mainClass = 'io.grpc.examples.helloworld.HelloWorldClient'
applicationName = 'hello-world-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task retryingHelloWorldServer(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.retrying.RetryingHelloWorldServer'
mainClass = 'io.grpc.examples.retrying.RetryingHelloWorldServer'
applicationName = 'retrying-hello-world-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task retryingHelloWorldClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.retrying.RetryingHelloWorldClient'
mainClass = 'io.grpc.examples.retrying.RetryingHelloWorldClient'
applicationName = 'retrying-hello-world-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task hedgingHelloWorldServer(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.hedging.HedgingHelloWorldServer'
mainClass = 'io.grpc.examples.hedging.HedgingHelloWorldServer'
applicationName = 'hedging-hello-world-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task hedgingHelloWorldClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.hedging.HedgingHelloWorldClient'
mainClass = 'io.grpc.examples.hedging.HedgingHelloWorldClient'
applicationName = 'hedging-hello-world-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task compressingHelloWorldClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.experimental.CompressingHelloWorldClient'
mainClass = 'io.grpc.examples.experimental.CompressingHelloWorldClient'
applicationName = 'compressing-hello-world-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task manualFlowControlClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.manualflowcontrol.ManualFlowControlClient'
mainClass = 'io.grpc.examples.manualflowcontrol.ManualFlowControlClient'
applicationName = 'manual-flow-control-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task manualFlowControlServer(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.manualflowcontrol.ManualFlowControlServer'
mainClass = 'io.grpc.examples.manualflowcontrol.ManualFlowControlServer'
applicationName = 'manual-flow-control-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

Expand Down
8 changes: 4 additions & 4 deletions examples/example-alts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ startScripts.enabled = false


task helloWorldAltsServer(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.alts.HelloWorldAltsServer'
mainClass = 'io.grpc.examples.alts.HelloWorldAltsServer'
applicationName = 'hello-world-alts-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task helloWorldAltsClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.alts.HelloWorldAltsClient'
mainClass = 'io.grpc.examples.alts.HelloWorldAltsClient'
applicationName = 'hello-world-alts-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

Expand Down
4 changes: 2 additions & 2 deletions examples/example-gauth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ sourceSets {
startScripts.enabled = false

task googleAuthClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.googleAuth.GoogleAuthClient'
mainClass = 'io.grpc.examples.googleAuth.GoogleAuthClient'
applicationName = 'google-auth-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

Expand Down
8 changes: 4 additions & 4 deletions examples/example-jwt-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ sourceSets {
startScripts.enabled = false

task hellowWorldJwtAuthServer(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.jwtauth.AuthServer'
mainClass = 'io.grpc.examples.jwtauth.AuthServer'
applicationName = 'auth-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task hellowWorldJwtAuthClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.jwtauth.AuthClient'
mainClass = 'io.grpc.examples.jwtauth.AuthClient'
applicationName = 'auth-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

Expand Down
8 changes: 4 additions & 4 deletions examples/example-tls/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ sourceSets {
startScripts.enabled = false

task helloWorldTlsServer(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.helloworldtls.HelloWorldServerTls'
mainClass = 'io.grpc.examples.helloworldtls.HelloWorldServerTls'
applicationName = 'hello-world-tls-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task helloWorldTlsClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.helloworldtls.HelloWorldClientTls'
mainClass = 'io.grpc.examples.helloworldtls.HelloWorldClientTls'
applicationName = 'hello-world-tls-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

Expand Down
8 changes: 4 additions & 4 deletions examples/example-xds/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ protobuf {
startScripts.enabled = false

task xdsHelloWorldClient(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.helloworldxds.XdsHelloWorldClient'
mainClass = 'io.grpc.examples.helloworldxds.XdsHelloWorldClient'
applicationName = 'xds-hello-world-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task xdsHelloWorldServer(type: CreateStartScripts) {
mainClassName = 'io.grpc.examples.helloworldxds.XdsHelloWorldServer'
mainClass = 'io.grpc.examples.helloworldxds.XdsHelloWorldServer'
applicationName = 'xds-hello-world-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

Expand Down
2 changes: 1 addition & 1 deletion examples/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit d44de50

Please sign in to comment.