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
workspace(name = "jgit")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
load("//tools:bazlets.bzl", "load_bazlets")
load_bazlets(commit = "f30a992da9fc855dce819875afb59f9dd6f860cd")
"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(
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",
],
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