Skip to content

Commit a81bf14

Browse files
committed
Upgrade to Guava 30.1, which warns on Java 7
This change can have large impact from two aspects: 1. It calls out a _large_ impact on the _few_ Java 7 users. 2. It may have _small_ impact on the _many_ Android users. #4671 tracks gRPC's removal of Java 7 support. We are quite eager to drop Java 7 support as that would allow using new language features like default methods. Guava is also dropping Java 7 support and starting in 30.1 it will warn when used on Java 7. The purpose of the warning is to help discover users that are negatively impacted by dropping Java 7 before it becomes a bigger problem. The Guava logging check was implemented in such a way that there is an optional class that uses Java 8 bytecode. While the class is optional at runtime, the Android build system notices when dexing and fails if Java 8 language featutres are not enabled. We believe this will not be a problem for most Android users, but they may need to add to their build: ``` android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } ``` See also https://github.com/google/guava/releases/tag/v30.1
1 parent bab1fe3 commit a81bf14

File tree

7 files changed

+25
-1
lines changed

7 files changed

+25
-1
lines changed

android-interop-testing/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ android {
2525
}
2626
}
2727
}
28+
compileOptions {
29+
sourceCompatibility JavaVersion.VERSION_1_8
30+
targetCompatibility JavaVersion.VERSION_1_8
31+
}
2832
compileSdkVersion 26
2933

3034
defaultConfig {

android/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ plugins {
88
description = 'gRPC: Android'
99

1010
android {
11+
compileOptions {
12+
sourceCompatibility JavaVersion.VERSION_1_8
13+
targetCompatibility JavaVersion.VERSION_1_8
14+
}
1115
compileSdkVersion 29
1216
defaultConfig {
1317
consumerProguardFiles "proguard-rules.txt"

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ subprojects {
5555
javaPluginPath = "$rootDir/compiler/build/exe/java_plugin/$protocPluginBaseName$exeSuffix"
5656

5757
nettyVersion = '4.1.52.Final'
58-
guavaVersion = '30.0-android'
58+
guavaVersion = '30.1-android'
5959
googleauthVersion = '0.22.2'
6060
protobufVersion = '3.12.0'
6161
protocVersion = protobufVersion

examples/android/clientcache/app/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apply plugin: 'com.android.application'
22
apply plugin: 'com.google.protobuf'
33

44
android {
5+
compileOptions {
6+
sourceCompatibility JavaVersion.VERSION_1_8
7+
targetCompatibility JavaVersion.VERSION_1_8
8+
}
59
compileSdkVersion 27
610

711
defaultConfig {

examples/android/helloworld/app/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apply plugin: 'com.android.application'
22
apply plugin: 'com.google.protobuf'
33

44
android {
5+
compileOptions {
6+
sourceCompatibility JavaVersion.VERSION_1_8
7+
targetCompatibility JavaVersion.VERSION_1_8
8+
}
59
compileSdkVersion 27
610

711
defaultConfig {

examples/android/routeguide/app/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apply plugin: 'com.android.application'
22
apply plugin: 'com.google.protobuf'
33

44
android {
5+
compileOptions {
6+
sourceCompatibility JavaVersion.VERSION_1_8
7+
targetCompatibility JavaVersion.VERSION_1_8
8+
}
59
compileSdkVersion 27
610

711
defaultConfig {

examples/android/strictmode/app/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apply plugin: 'com.android.application'
22
apply plugin: 'com.google.protobuf'
33

44
android {
5+
compileOptions {
6+
sourceCompatibility JavaVersion.VERSION_1_8
7+
targetCompatibility JavaVersion.VERSION_1_8
8+
}
59
compileSdkVersion 28
610

711
defaultConfig {

0 commit comments

Comments
 (0)