| commit | a27c7de6503387a5d3675d373979c40621413552 | [log] [tgz] |
|---|---|---|
| author | Googler <hvd@google.com> | Wed Nov 05 02:07:13 2025 -0800 |
| committer | rules_java Copybara <noreply@google.com> | Wed Nov 05 02:08:15 2025 -0800 |
| tree | b669790e4f7075cdec9b644df5b97700a91f9d58 | |
| parent | 67e83ef06b854fef89cec3a96c158afd99456055 [diff] |
Cut the dependency on ijar when not stripping the bootclasspath Rule deps are fetched eagerly, even if unused, so we need to actually cut the edge to ijar when not stripping for bazel bootstrapping to succeed. Unfortunately, with the way Bazel integration tests are set up, there's no way to test this with Bazel without making a release. I manually verified that `bazel query deps()` reports the right results and the targets build correctly. ``` $ bazel query 'deps(//toolchains:platformclasspath, 1)' //:license //toolchains:DumpPlatformClassPath.java //toolchains:current_java_runtime //toolchains:ijar //toolchains:incompatible_language_version_bootclasspath_enabled //toolchains:language_version_bootstrap_runtime //toolchains:platformclasspath //toolchains:utf8_environment @bazel_tools//tools/allowlists/function_transition_allowlist:function_transition_allowlist @bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type $ bazel query 'deps(//toolchains:platformclasspath_unstripped, 1)' //:license //toolchains:DumpPlatformClassPath.java //toolchains:current_java_runtime //toolchains:incompatible_language_version_bootclasspath_enabled //toolchains:language_version_bootstrap_runtime //toolchains:platformclasspath_unstripped //toolchains:utf8_environment @bazel_tools//tools/allowlists/function_transition_allowlist:function_transition_allowlist @bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type ``` (ignore-relnotes) PiperOrigin-RevId: 828368783 Change-Id: Ie29eea882ad41e4efa8f1dd752679a221a239ae1
Java Rules for Bazel https://bazel.build.
Documentation
For a quickstart tutorial, see https://bazel.build/start/java
For slightly more advanced usage, like setting up toolchains or writing your own java-like rules, see https://bazel.build/docs/bazel-and-java
Core Java rules
Add a load like:
load("@rules_java//java:java_library.bzl", "java_library")
to your BUILD / BUILD.bazel / bzl` files
For detailed docs on the core rules, see https://bazel.build/reference/be/java