Skip to content

Commit

Permalink
fix: focus 'Running the Plugin' documentation on googleapis, not show…
Browse files Browse the repository at this point in the history
…case (#1196)
  • Loading branch information
burkedavison authored Dec 22, 2022
1 parent d926d4b commit d58b2e5
Showing 1 changed file with 9 additions and 73 deletions.
82 changes: 9 additions & 73 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,72 +183,13 @@ $ mvn compile -P update

## Running the Plugin

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.

```sh
mkdir googleapis/google/showcase
cp -r gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta1
```

3. Add the new microgenerator rules to
`googleapis/google/showcase/v1beta1/BUILD.bazel` file as follows:

```python
load(
"@com_google_googleapis_imports//:imports.bzl",
# Existing rules here.
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_proto_library",
"proto_library_with_info",
)
proto_library_with_info(
name = "showcase_proto_with_info",
deps = [
":showcase_proto",
],
)
java_proto_library(
name = "showcase_java_proto",
deps = [
":showcase_proto",
],
)
# This should either replace the existing monolith target or have a unique name
# that includes "java_gapic".
java_gapic_library(
name = "showcase_java_gapic",
srcs = [":showcase_proto_with_info"],
grpc_service_config = "showcase_grpc_service_config.json",
test_deps = [
":showcase_java_grpc",
],
deps = [
":showcase_java_proto",
],
)
java_gapic_assembly_gradle_pkg(
# This name should be unique from the existing target name.
name = "google-cloud-showcase-v1beta1-java",
deps = [
# This is the new microgen target above.
":showcase_java_gapic",
# The following targets already exist.
":showcase_java_grpc",
":showcase_java_proto",
":showcase_proto",
],
)
```

4. Point to local gapic-generator-java
See also above section "Showcase Integration Testing".

To generate a production GAPIC API:

1. Clone [googleapis](https://github.com/googleapis/googleapis).

2. Point to local gapic-generator-java

Normally, googleapis's build pulls in googleapis/gapic-generator-java from the
Internet:
Expand All @@ -265,7 +206,7 @@ $ mvn compile -P update
)
```

By replacing this portion using the built-in local_repository rule, you can mak
By replacing this portion using the built-in local_repository rule, you can make
it refer to your local development repo:

```
Expand All @@ -275,12 +216,7 @@ $ mvn compile -P update
)
```

5. Build the new target.
```sh
cd googleapis
bazel build //google/showcase/v1beta1:showcase_java_gapic
```
3. Build the new target.

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`
Expand Down

0 comments on commit d58b2e5

Please sign in to comment.