aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanjaypujare <sanjaypujare@users.noreply.github.com>2023-09-11 13:41:50 -0700
committerGitHub <noreply@github.com>2023-09-11 13:41:50 -0700
commit923ac604162f94f906c0c7a36821671abbfd9e76 (patch)
tree22c3b4e0593ee159287261c8f71adf61345a6f9e
parentb839b38b835b76aec31ae3975cded5643e0f35a1 (diff)
downloadgrpc-grpc-java-923ac604162f94f906c0c7a36821671abbfd9e76.tar.gz
api: don't generate Java7 bytecode with Java 20+ (#10552)
Java 20+ don't support --release 7, so we just will use the default (8).
-rw-r--r--api/build.gradle4
1 files changed, 3 insertions, 1 deletions
diff --git a/api/build.gradle b/api/build.gradle
index 3a77ee243..d3d602b3b 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -17,7 +17,9 @@ sourceSets {
}
tasks.named("compileContextJava").configure {
- if (JavaVersion.current().isJava9Compatible()) {
+ if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20)) {
+ println("!!! Javac does not support generating Java 7 bytecode. Do not use for release builds !!!")
+ } else if (JavaVersion.current().isJava9Compatible()) {
options.release = 7
} else {
sourceCompatibility = JavaVersion.VERSION_1_7