Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@mikaylakonst

Description

@mikaylakonst
Issue body actions

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
}

Metadata

Metadata

Assignees

Labels

priority: p4type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error 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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.