Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mikaylakonst opened this issue Feb 16, 2023 · 0 comments · Fixed by #2593
Assignees
Labels
priority: p4 type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@mikaylakonst
Copy link

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
}
@mikaylakonst mikaylakonst added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 16, 2023
@noahdietz noahdietz transferred this issue from googleapis/rules_gapic Feb 16, 2023
suztomo pushed a commit that referenced this issue Mar 21, 2023
* chore: update java template

* chore: fix tests

* chore: fix tests

* chore: update project
Source-Link: googleapis/synthtool@1155a97
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:b0b1c1c89570e229b1026372a2b8989ba31495007055b8d30178b7648503eefa

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
suztomo pushed a commit that referenced this issue Mar 21, 2023
* chore: update java template

* chore: fix tests

* chore: fix tests

* chore: update project
Source-Link: googleapis/synthtool@1155a97
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:b0b1c1c89570e229b1026372a2b8989ba31495007055b8d30178b7648503eefa
@blakeli0 blakeli0 added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Aug 2, 2023
@lqiu96 lqiu96 added priority: p4 and removed priority: p3 Desirable enhancement or fix. May not be included in next release. labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p4 type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants