-
Notifications
You must be signed in to change notification settings - Fork 74
docs: development with local gapic-generator-java #1132
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,17 +97,17 @@ | |
|
|
||
| ## Running the Plugin | ||
|
|
||
| 1. Clone [googleapis](https://github.com/googleapis/googleapis) and | ||
| 1. Clone [googleapis](https://github.com/googleapis/googleapis) and | ||
| [gapic-showcase](https://github.com/googleapis/gapic-showcase/). | ||
|
|
||
| 2. Copy the protos from Showcase into googleapis/google/showcase. | ||
| 2. Copy the protos from Showcase into googleapis/google/showcase. | ||
|
|
||
| ```sh | ||
| mkdir googleapis/google/showcase | ||
| cp -r gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta1 | ||
| ``` | ||
|
|
||
| 3. Add the new microgenerator rules to | ||
| 3. Add the new microgenerator rules to | ||
| `googleapis/google/showcase/v1beta1/BUILD.bazel` file as follows: | ||
|
|
||
| ```python | ||
|
|
@@ -162,8 +162,49 @@ | |
| ) | ||
| ``` | ||
|
|
||
| 4. Build the new target. | ||
| 4. Point to local gapic-generator-java | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks Tomo! It's good to have a section that points to local repo, just be aware that this section will change very soon once we merge #918. We will point googleapis to a local jar instead of a path to local repo.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds good. Not a blocker for this pull request. |
||
|
|
||
| Normally, googleapis's build pulls in googleapis/gapic-generator-java from the | ||
| Internet: | ||
|
|
||
| ``` | ||
| # Java microgenerator. | ||
| … | ||
| _gapic_generator_java_version = "2.1.0" | ||
|
|
||
| http_archive( | ||
| name = "gapic_generator_java", | ||
| … | ||
| urls = ["https://github.com/googleapis/gapic-generator-java/archive/v%s.zip" % _gapic_generator_java_version], | ||
| ) | ||
| ``` | ||
|
|
||
| By replacing this portion using the built-in local_repository rule, you can mak | ||
| it refer to your local development repo: | ||
|
|
||
| ``` | ||
| local_repository( | ||
| name = "gapic_generator_java", | ||
| path = "/home/<your id>/gapic-generator-java", | ||
| ) | ||
| ``` | ||
|
|
||
| 5. Build the new target. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Steps looks good; wondering if you wanted to add a step on how to build any client library (e.g. technically you don't need to build the showcase service, can build any service). Something like: You can generate any client library based on the protos within
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good. I added 83d2607 with |
||
|
|
||
| ```sh | ||
| cd googleapis | ||
| bazel build //google/showcase/v1beta1:showcase_java_gapic | ||
| ``` | ||
|
|
||
| You can generate any client library based on the protos within googleapis. | ||
| You just need the name of the service within the `java_gapic_assembly_gradle_pkg` | ||
| rules within the service's `BUILD.bazel` file. | ||
| For instance, to run your local generator on the `speech`'s v2 service, you can | ||
| run: | ||
|
|
||
| ``` | ||
| bazel build //google/cloud/speech/v2:google-cloud-speech-v2-java | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ```sh | ||
| bazel build //google/showcase/v1beta1:showcase_java_gapic | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My IntelliJ tells that it was unnecessary space.