Bazel: Switch to using toolchain resolution for java rules Bump Bazel version to release 5.0.0. In this new Bazel release, --incompatible_use_toolchain_resolution_for_java_rules is flipped, that means that the build must be adapted to toolchain resolution. Given that new Bazel release also added support for remote JDK 17, add support for building with remote JDK 17 to produce major byte code version 61. Change-Id: I5bc5f640bcd43529f799a8df01ad4a496f0394d3
diff --git a/tools/BUILD b/tools/BUILD index ec76f1b..500e197 100644 --- a/tools/BUILD +++ b/tools/BUILD
@@ -6,11 +6,23 @@ default_java_toolchain( name = "error_prone_warnings_toolchain_java11", - source_version = "11", - target_version = "11", package_configuration = [ ":error_prone", ], + source_version = "11", + target_version = "11", + visibility = ["//visibility:public"], +) + +default_java_toolchain( + name = "error_prone_warnings_toolchain_java17", + configuration = dict(), + java_runtime = "@bazel_tools//tools/jdk:remotejdk_17", + package_configuration = [ + ":error_prone", + ], + source_version = "17", + target_version = "17", visibility = ["//visibility:public"], )