Skip to content

javadoc rule doc_deps should (have an be option to be) more lenient and ignore any missing '_JavadocInfo' #1344

Open
@vorburger

Description

@vorburger

I wouldl like https://docs.enola.dev/dev/javadoc/ not to include the JavaDoc of ProtoBuf, gRPC and javax.annotation, but only of that project itself - seems reasonable, no? 😆

But when I change this:

javadoc(
    name = "javadoc",
    doc_url = "https://docs.enola.dev/dev/javadoc/",
    deps = [
        ":enola",
        "@enola_maven//:com_google_protobuf_protobuf_java",
        "@enola_maven//:com_google_protobuf_protobuf_java_util",
        "@enola_maven//:javax_annotation_javax_annotation_api",
    ],
)

to this:

javadoc(
    name = "javadoc",
    doc_url = "https://docs.enola.dev/dev/javadoc/",
    deps = [
        ":enola",
    ],
    doc_deps = [
        "@enola_maven//:com_google_protobuf_protobuf_java",
        "@enola_maven//:com_google_protobuf_protobuf_java_util",
        "@enola_maven//:javax_annotation_javax_annotation_api",
    ],
)

then bazelisk build //java/dev/enola:javadoc just fails like this:

ERROR: /home/vorburger/git/github.com/enola-dev/enola/java/dev/enola/BUILD:77:8: in doc_deps attribute of javadoc rule //java/dev/enola:javadoc: '@@protobuf+//java/core:core' does not have mandatory providers: '_JavadocInfo'
ERROR: /home/vorburger/git/github.com/enola-dev/enola/java/dev/enola/BUILD:77:8: in doc_deps attribute of javadoc rule //java/dev/enola:javadoc: '@@protobuf+//java/util:util' does not have mandatory providers: '_JavadocInfo'
ERROR: /home/vorburger/git/github.com/enola-dev/enola/java/dev/enola/BUILD:77:8: in doc_deps attribute of javadoc rule //java/dev/enola:javadoc: '@@rules_jvm_external++maven+enola_maven//:javax_annotation_javax_annotation_api' does not have mandatory providers: '_JavadocInfo'
ERROR: /home/vorburger/git/github.com/enola-dev/enola/java/dev/enola/BUILD:77:8: Analysis of target '//java/dev/enola:javadoc' failed
ERROR: Analysis of target '//java/dev/enola:javadoc' failed; build aborted
INFO: Elapsed time: 0.425s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

This seems unncessarily strict, no? In a real world project, one may well depends on targets which do not correctly publish JavaDoc themselves. It should (IMHO) still be possible to generate JavaDoc for a project with such dependencies - and simply have the rules_jvm_external javadoc rule ignore a few missing implicit javadoc targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions