aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.bazelrc13
-rw-r--r--.bazelversion2
-rw-r--r--WORKSPACE5
-rw-r--r--tools/BUILD14
4 files changed, 30 insertions, 4 deletions
diff --git a/.bazelrc b/.bazelrc
index e24be88639..7626e5b472 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -3,7 +3,18 @@ build --repository_cache=~/.gerritcodereview/bazel-cache/repository
build --experimental_strict_action_env
build --action_env=PATH
build --disk_cache=~/.gerritcodereview/bazel-cache/cas
-build --java_toolchain //tools:error_prone_warnings_toolchain
+
+# Builds using remote_jdk11, executes using remote_jdk11 or local_jdk
+build --java_language_version=11
+build --java_runtime_version=remotejdk_11
+build --tool_java_language_version=11
+build --tool_java_runtime_version=remotejdk_11
+
+# Builds using remote_jdk17, executes using remote_jdk11 or local_jdk
+build:java17 --java_language_version=17
+build:java17 --java_runtime_version=remotejdk_17
+build:java17 --tool_java_language_version=17
+build:java17 --tool_java_runtime_version=remotejdk_17
test --build_tests_only
test --test_output=errors
diff --git a/.bazelversion b/.bazelversion
index fcdb2e109f..0062ac9718 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1 +1 @@
-4.0.0
+5.0.0
diff --git a/WORKSPACE b/WORKSPACE
index 83838b7017..1d0aaceeb8 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,7 +1,6 @@
workspace(name = "jgit")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
load("//tools:bazlets.bzl", "load_bazlets")
load_bazlets(commit = "f30a992da9fc855dce819875afb59f9dd6f860cd")
@@ -11,6 +10,10 @@ load(
"maven_jar",
)
+register_toolchains("//tools:error_prone_warnings_toolchain_java11_definition")
+
+register_toolchains("//tools:error_prone_warnings_toolchain_java17_definition")
+
JMH_VERS = "1.32"
maven_jar(
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