summaryrefslogtreecommitdiffstats
path: root/.bazelrc
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 /.bazelrc
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 '.bazelrc')
-rw-r--r--.bazelrc13
1 files changed, 12 insertions, 1 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