aboutsummaryrefslogtreecommitdiffstats
path: root/tools/BUILD
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2021-12-24 07:43:48 +0100
committerDavid Ostrovsky <d.ostrovsky@gmx.de>2022-01-20 06:40:51 -0400
commitbe732c16ab1834162ed1c215a695c8b1486add9a (patch)
treef4ee6e0fc8caae0198c8b89af638830e477aa0ad /tools/BUILD
parentc812947962103c427a202f6df38d23e1088007f1 (diff)
downloadjgit-be732c16ab1834162ed1c215a695c8b1486add9a.tar.gz
jgit-be732c16ab1834162ed1c215a695c8b1486add9a.zip
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. Specification toolchain resolution for java rules is here: [1]. Main tracking Bazel issue is here: [2]. Given that new Bazel release also added support for remote JDK 17, add experimental support for building with remote JDK 17 to produce major byte code version 61. Test Plan: To build with remote JDK 11 run: $ bazel build :all To build with remote JDK 17 run: $ bazel build --config java17 :all [1] https://docs.google.com/document/d/1MVbBxbKVKRJJY7DnkptHpvz7ROhyAYy4a-TZ-n7Q0r4/edit?usp=sharing [2] https://github.com/bazelbuild/bazel/issues/7849 Change-Id: I8d26dff722c6677ea7642913b61e416b23ea9041
Diffstat (limited to 'tools/BUILD')
-rw-r--r--tools/BUILD14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/BUILD b/tools/BUILD
index b80b2bb3ab..a10901982f 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -5,7 +5,7 @@ load(
load("@rules_java//java:defs.bzl", "java_package_configuration")
default_java_toolchain(
- name = "error_prone_warnings_toolchain",
+ name = "error_prone_warnings_toolchain_java11",
package_configuration = [
":error_prone",
],
@@ -14,6 +14,18 @@ default_java_toolchain(
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"],
+)
+
# Error Prone errors enabled by default; see ../.bazelrc for how this is
# enabled. This warnings list is originally based on:
# https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl