Skip to content
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
This repository was archived by the owner on Oct 29, 2026. It is now read-only.

java_gapic_assembly_gradle_pkg rule does not generate javadocs task in client build.gradle #1367

Closed

Description

@mikaylakonst

Environment details

  • Programming language: Java

Steps to reproduce

I use bazel to build a java_gapic_assembly_gradle_pkg rule to build a java client library tar:

java_gapic_assembly_gradle_pkg(
    name = "API-v1-java",
    include_samples = True,
    transport = "grpc+rest",
    deps = [
        ":FOO_java_gapic",
        ":FOO_java_grpc",
        ":FOO_java_proto",
        ":FOO_proto",
    ],
)

When java_gapic_assembly_gradle_pkg is used to generate a java client library tar, if you run ./gradlew build from the top-level directory of the extracted tar, it will generate javadocs for proto and grpc, but not for the gapic client

Expected behavior:

When I run ./gradlew build from the top level directory of the extracted tar generated by the java_gapic_assembly_gradle_pkg rule, these javadocs should be generated:

API-v1-java/gapic-API-v1-java/build/docs/javadoc
API-v1-java/grpc-API-v1-java/build/docs/javadoc
API-v1-java/proto-API-v1-java/build/docs/javadoc

Actual behavior:

Only the grpc and proto javadocs are generated, but not the gapic javadocs

Suggested Fix

https://github.com/googleapis/rules_gapic/blob/main/java/resources/gradle/client.gradle.tmpl

https://github.com/googleapis/rules_gapic/blob/main/java/resources/gradle/client_disco.gradle.tmpl

It looks like these are templates that are used by the java_gapic_assembly_gradle_pkg rule to generate the build.gradle file for the gapic client, and they do not contain a task for generating javadocs.

By contrast, the gradle template files for proto and grpc do:

https://github.com/googleapis/rules_gapic/blob/main/java/resources/gradle/proto.gradle.tmpl

https://github.com/googleapis/rules_gapic/blob/main/java/resources/gradle/grpc.gradle.tmpl

Could add this to https://github.com/googleapis/rules_gapic/blob/main/java/resources/gradle/client.gradle.tmpl and https://github.com/googleapis/rules_gapic/blob/main/java/resources/gradle/client_disco.gradle.tmpl

task javadocJar(type: Jar) {
  classifier = 'javadoc'
  from javadoc
}

artifacts {
  archives javadocJar
}

Activity

  1. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Feb 16, 2023
  2. added
    priority: p3Desirable enhancement or fix. May not be included in next release.
    and removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Aug 2, 2023
  3. added and removed
    priority: p3Desirable enhancement or fix. May not be included in next release.
    on Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: p4type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions