Bazel 5: Rules_java needs to export the defs.bzl file to allow generating docs #14370
Labels
P4
This is either out of scope or we don't have bandwidth to review a PR. (No assignee)
team-Documentation
Documentation improvements that cannot be directly linked to other team labels
team-Rules-Java
Issues for Java rules
type: documentation (cleanup)
Description of the problem / feature request:
With Bazel 5, the
rules_java
have been moved to the internal to Bazel itself. This has removed access to the rules javadefs.bzl
file. This in turn blocks our ability to generate our internal build documentation.Feature requests: what underlying problem are you trying to solve with this feature?
When building the documentation for our project using Stardoc, we need to include all of the dependencies. Since we use
rules_java
in our project we need to include those. We use thebazel-skylib
with thebzl_library
to collect the.bzl
files to provide to the stardoc rules with the references to generate the documentation.Using the
bzl_library
to collect therules_java
results in the error:ERROR: /Users/tjoneslo/Documents/workspace/java/BUILD.bazel:87:12: no such target '@rules_java//java:defs.bzl': target 'defs.bzl' not declared in package 'java'; however, a source file of this name exists. (Perhaps add 'exports_files(["defs.bzl"])' to java/BUILD?) defined by /private/var/tmp/_bazel_tjoneslo/36945587f23d21b910d2b6901d7e1f8e/external/rules_java/java/BUILD and referenced by '//java:rules-java-docs'
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
WORKSPACE:
BUILD.bazel
What operating system are you running Bazel on?
What's the output of
bazel info release
?% bazel info release
INFO: Invocation ID: b9bb1040-1962-4f14-9fee-91d653c399f0
release 5.0.0rc2
Have you found anything relevant by searching the web?
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: