|
12 | 12 | cp .githooks/pre-commit .git/hooks/pre-commit
|
13 | 13 | ```
|
14 | 14 |
|
15 |
| -## Running the Plugin |
16 |
| - |
17 |
| -1. Clone [googleapis](https://github.com/googleapis/googleapis) and |
18 |
| - [gapic-showcase](https://github.com/googleapis/gapic-showcase/). |
19 |
| - |
20 |
| -2. Copy the protos from Showcase into googleapis/google/showcase. |
21 |
| - |
22 |
| - ```sh |
23 |
| - mkdir googleapis/google/showcase |
24 |
| - cp -r gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta1 |
25 |
| - ``` |
26 |
| - |
27 |
| -3. Add the new microgenerator rules to |
28 |
| - `googleapis/google/showcase/v1beta1/BUILD.bazel` file as follows: |
29 |
| - |
30 |
| - ```python |
31 |
| - load( |
32 |
| - "@com_google_googleapis_imports//:imports.bzl", |
33 |
| - # Existing rules here. |
34 |
| - "java_gapic_assembly_gradle_pkg", |
35 |
| - "java_gapic_library", |
36 |
| - "java_proto_library", |
37 |
| - "proto_library_with_info", |
38 |
| - ) |
39 |
| -
|
40 |
| - proto_library_with_info( |
41 |
| - name = "showcase_proto_with_info", |
42 |
| - deps = [ |
43 |
| - ":showcase_proto", |
44 |
| - ], |
45 |
| - ) |
46 |
| -
|
47 |
| - java_proto_library( |
48 |
| - name = "showcase_java_proto", |
49 |
| - deps = [ |
50 |
| - ":showcase_proto", |
51 |
| - ], |
52 |
| - ) |
53 |
| -
|
54 |
| - # This should either replace the existing monolith target or have a unique name |
55 |
| - # that includes "java_gapic". |
56 |
| - java_gapic_library( |
57 |
| - name = "showcase_java_gapic", |
58 |
| - srcs = [":showcase_proto_with_info"], |
59 |
| - grpc_service_config = "showcase_grpc_service_config.json", |
60 |
| - test_deps = [ |
61 |
| - ":showcase_java_grpc", |
62 |
| - ], |
63 |
| - deps = [ |
64 |
| - ":showcase_java_proto", |
65 |
| - ], |
66 |
| - ) |
67 |
| -
|
68 |
| - java_gapic_assembly_gradle_pkg( |
69 |
| - # This name should be unique from the existing target name. |
70 |
| - name = "google-cloud-showcase-v1beta1-java", |
71 |
| - deps = [ |
72 |
| - # This is the new microgen target above. |
73 |
| - ":showcase_java_gapic", |
74 |
| - # The following targets already exist. |
75 |
| - ":showcase_java_grpc", |
76 |
| - ":showcase_java_proto", |
77 |
| - ":showcase_proto", |
78 |
| - ], |
79 |
| - ) |
80 |
| - ``` |
81 |
| - |
82 |
| -4. Build the new target. |
83 |
| - |
84 |
| - ```sh |
85 |
| - bazel build //google/showcase/v1beta1:showcase_java_gapic |
86 |
| - ``` |
87 |
| - |
88 | 15 | ## Code Formatting
|
89 | 16 |
|
90 | 17 | - Run linter checks without actually doing the formatting.
|
|
167 | 94 | ```sh
|
168 | 95 | bazel run //test/integration:update_redis
|
169 | 96 | ```
|
| 97 | + |
| 98 | +## Running the Plugin |
| 99 | + |
| 100 | +1. Clone [googleapis](https://github.com/googleapis/googleapis) and |
| 101 | + [gapic-showcase](https://github.com/googleapis/gapic-showcase/). |
| 102 | + |
| 103 | +2. Copy the protos from Showcase into googleapis/google/showcase. |
| 104 | + |
| 105 | + ```sh |
| 106 | + mkdir googleapis/google/showcase |
| 107 | + cp -r gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta1 |
| 108 | + ``` |
| 109 | + |
| 110 | +3. Add the new microgenerator rules to |
| 111 | + `googleapis/google/showcase/v1beta1/BUILD.bazel` file as follows: |
| 112 | + |
| 113 | + ```python |
| 114 | + load( |
| 115 | + "@com_google_googleapis_imports//:imports.bzl", |
| 116 | + # Existing rules here. |
| 117 | + "java_gapic_assembly_gradle_pkg", |
| 118 | + "java_gapic_library", |
| 119 | + "java_proto_library", |
| 120 | + "proto_library_with_info", |
| 121 | + ) |
| 122 | +
|
| 123 | + proto_library_with_info( |
| 124 | + name = "showcase_proto_with_info", |
| 125 | + deps = [ |
| 126 | + ":showcase_proto", |
| 127 | + ], |
| 128 | + ) |
| 129 | +
|
| 130 | + java_proto_library( |
| 131 | + name = "showcase_java_proto", |
| 132 | + deps = [ |
| 133 | + ":showcase_proto", |
| 134 | + ], |
| 135 | + ) |
| 136 | +
|
| 137 | + # This should either replace the existing monolith target or have a unique name |
| 138 | + # that includes "java_gapic". |
| 139 | + java_gapic_library( |
| 140 | + name = "showcase_java_gapic", |
| 141 | + srcs = [":showcase_proto_with_info"], |
| 142 | + grpc_service_config = "showcase_grpc_service_config.json", |
| 143 | + test_deps = [ |
| 144 | + ":showcase_java_grpc", |
| 145 | + ], |
| 146 | + deps = [ |
| 147 | + ":showcase_java_proto", |
| 148 | + ], |
| 149 | + ) |
| 150 | +
|
| 151 | + java_gapic_assembly_gradle_pkg( |
| 152 | + # This name should be unique from the existing target name. |
| 153 | + name = "google-cloud-showcase-v1beta1-java", |
| 154 | + deps = [ |
| 155 | + # This is the new microgen target above. |
| 156 | + ":showcase_java_gapic", |
| 157 | + # The following targets already exist. |
| 158 | + ":showcase_java_grpc", |
| 159 | + ":showcase_java_proto", |
| 160 | + ":showcase_proto", |
| 161 | + ], |
| 162 | + ) |
| 163 | + ``` |
| 164 | + |
| 165 | +4. Build the new target. |
| 166 | + |
| 167 | + ```sh |
| 168 | + bazel build //google/showcase/v1beta1:showcase_java_gapic |
| 169 | + ``` |
0 commit comments