Construct java_common with explicit fields (#388) `java_common` is currently the result of an unannotated factory. [sty](https://github.com/tamird/sty) loses its field types at that boundary: `java_common.BootClassPathInfo` becomes unknown instead of a provider key, and `java_common.compile` loses its callable signature. Construct the unconditional fields directly in `struct(...)` and collect conditional fields in a helper. The field values, conditions, and evaluation order are preserved. A downstream sty check now resolves the provider key and callable signature. Prepared with OpenAI Codex. Closes #388 COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_java/pull/388 from tamird:codex/sty-ratchet-java-common-fields ddd484a4dc5e46879bca1df691f6648fa274d63d PiperOrigin-RevId: 1033360418 Change-Id: I42811aa436dca932577afaec76c993d6692e1589
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