Define the Java toolchain types in rules_java (#392)

Defines `//toolchains:toolchain_type`, `:runtime_toolchain_type` and `:bootstrap_runtime_toolchain_type` as the actual toolchain types rather than aliases into `@bazel_tools`, conditional on a `bazel_features` feature that is always `False` for now. https://github.com/bazelbuild/bazel/pull/32196 will allow them to be flipped over. Until then and on all older versions they are aliases of the types in `@bazel_tools`, so both labels always refer to the same type.

Work towards bazelbuild/bazel#32428

Closes #392

COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_java/pull/392 from fmeum:java-toolchain-types 41f05fc81aba83ee0b317c07ccc87b60d8295690
PiperOrigin-RevId: 1022628752
Change-Id: I8a330969a62951cec2db1484cee3a6a658b2e119
5 files changed
tree: 58a67f545199b40b560981e404f845db12ceebc4
  1. .bazel_checkout/
  2. .bazelci/
  3. .bcr/
  4. .github/
  5. distro/
  6. examples/
  7. java/
  8. test/
  9. third_party/
  10. toolchains/
  11. .bazelignore
  12. .bazelrc
  13. .gitignore
  14. AUTHORS
  15. BUILD
  16. CODEOWNERS
  17. CONTRIBUTING.md
  18. LICENSE
  19. MODULE.bazel
  20. README.md
  21. renovate.json
  22. WORKSPACE
  23. WORKSPACE.bzlmod
README.md

rules_java

Build status

Java Rules for Bazel https://bazel.build.

Documentation

For a quickstart tutorial, see https://bazel.build/start/java

The fastest way to try this in an empty project is to click the green “Use this template” button on https://github.com/bazel-starters/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