aboutsummaryrefslogtreecommitdiffstats
path: root/tools/BUILD
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2021-11-02 18:47:26 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2021-11-03 23:45:32 +0100
commit4184ff0953b2569799221d423e77fd2f6880f77d (patch)
treef59ad5c69e63406b389d1c6d68bc934a0f29ade8 /tools/BUILD
parent30a8afd768419965441705f4e20f094275cc03ab (diff)
downloadjgit-4184ff0953b2569799221d423e77fd2f6880f77d.tar.gz
jgit-4184ff0953b2569799221d423e77fd2f6880f77d.zip
[releng] Make the bazel build use Java 11
Make the default toolchain use Java 11, and fix two errorprone findings introduced recently. Change-Id: Iff51206fe8bdf096cb7d88cb1a499002550766cd Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'tools/BUILD')
-rw-r--r--tools/BUILD19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/BUILD b/tools/BUILD
index 2b208744b5..7bfab2d06c 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -5,10 +5,27 @@ load(
)
load("@rules_java//java:defs.bzl", "java_package_configuration")
+JDK11_JVM_OPTS = [
+ "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
+ "--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
+ "--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
+ "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
+ "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
+ "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
+ "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
+ "--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
+ "--patch-module=java.compiler=$(location @bazel_tools//tools/jdk:java_compiler_jar)",
+ "--patch-module=jdk.compiler=$(location @bazel_tools//tools/jdk:jdk_compiler_jar)",
+ "--add-opens=java.base/java.nio=ALL-UNNAMED",
+ "--add-opens=java.base/java.lang=ALL-UNNAMED",
+]
+
default_java_toolchain(
name = "error_prone_warnings_toolchain",
bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath.jar"],
- jvm_opts = JDK9_JVM_OPTS,
+ jvm_opts = JDK11_JVM_OPTS,
+ source_version = "11",
+ target_version = "11",
package_configuration = [
":error_prone",
],