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

fix: focus 'Running the Plugin' documentation on googleapis, not showcase #1196

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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