@@ -5,6 +5,9 @@ This document describes the steps required to add a new library to
55familiar with the existing libraries, the build systems used in those libraries,
66and which libraries are based on gRPC.
77
8+ - [ Adding a new library] ( #adding-a-new-library )
9+ - [ Expanding a library] ( #expanding-a-library )
10+
811## Adding a new library
912
1013> :warning : For libraries that include multiple services, the scaffold README
@@ -35,12 +38,22 @@ bazel --batch query --noshow_progress --noshow_loading_progress \
3538 " kind(cc_library, @com_google_googleapis//${subdir} /...)"
3639```
3740
38- If this fails, send a CL to add the rule. Wait until that is submitted and
39- exported before proceeding any further.
41+ If the command fails, it returns something like this:
42+
43+ ``` shell
44+ ERROR: no targets found beneath ' commerce'
45+ ```
46+
47+ This means the dependency does not exist at the pinned version of the googleapis
48+ repo.
49+ [ Send a PR to update the googleapis SHA to the latest version] ( ../contributor/howto-guide-update-googleapis-sha.md ) .
50+ Wait until that is submitted before proceeding any further.
4051
4152### Edit the scripts and configuration
4253
43- Update the ` external/googleapis/update_libraries.sh ` script.
54+ Update the
55+ [ external/googleapis/update_libraries.sh] ( ../../external/googleapis/update_libraries.sh )
56+ script.
4457
4558<details >
4659<summary >Expand for an example</summary >
@@ -71,7 +84,9 @@ index cdaa0bc9f..b0381d72d 100755
7184Determine the retryable status codes by looking in the service config JSON. For
7285example, [ here] [ retryable-status-codes ] .
7386
74- Manually edit ` generator/generator_config.textproto ` and add the new service.
87+ Manually edit
88+ [ generator/generator_config.textproto] ( ../../generator/generator_config.textproto )
89+ and add the new service.
7590
7691Find the list of ` .proto ` files that will need to be included:
7792
@@ -149,6 +164,12 @@ git add "google/cloud/${library}"
149164ci/cloudbuild/build.sh -t checkers-pr
150165```
151166
167+ ### Verify the generated changes look right
168+
169+ ``` shell
170+ tree google/cloud/$library
171+ ```
172+
152173### Commit all the generated files
153174
154175``` shell
@@ -186,14 +207,16 @@ knows about one such subdirectory. You may need to manually update the
186207
187208### Update the root files
188209
189- Manually edit ` cmake/GoogleCloudCppFeatures.cmake ` to include the new target. If
190- you are generating a GA library, add it to ` GOOGLE_CLOUD_CPP_GA_LIBRARIES ` .
191- Otherwise, if you are generating an experimental library, add it to
192- ` GOOGLE_CLOUD_CPP_EXPERIMENTAL_LIBRARIES ` and note in a comment when the library
193- was generated.
210+ Manually edit
211+ [ cmake/GoogleCloudCppFeatures.cmake] ( ../../cmake/GoogleCloudCppFeatures.cmake )
212+ to include the new target. If you are generating a GA library, add it to
213+ ` GOOGLE_CLOUD_CPP_GA_LIBRARIES ` . Otherwise, if you are generating an
214+ experimental library, add it to ` GOOGLE_CLOUD_CPP_EXPERIMENTAL_LIBRARIES ` and
215+ note in a comment when the library was generated.
194216
195- Update ` libraries.bzl ` to include the new library. While this can be done by
196- running a cmake-based build, it is fastest to edit the file manually.
217+ Update [ libraries.bzl] ( ../../libraries.bzl ) to include the new library. While
218+ this can be done by running a cmake-based build, it is fastest to edit the file
219+ manually.
197220
198221### Update the quickstart
199222
@@ -219,7 +242,7 @@ running while you work on tweaks to the quickstart and documentation.
219242``` shell
220243env GOOGLE_CLOUD_CPP_CHECK_API=${library} ci/cloudbuild/build.sh -t check-api-pr
221244git add ci/abi-dumps
222- git commit -m" Add API baseline"
245+ git commit -m " Add API baseline"
223246```
224247
225248### Update the README files
@@ -244,7 +267,8 @@ with older services we need to edit a few places:
244267
245268### Edit the top-level CHANGELOG file
246269
247- Announce the new library in the CHANGELOG for the next release.
270+ Announce the new library in the [ CHANGELOG.md] ( ../CHANGELOG.md ) for the next
271+ release.
248272
249273### Fix formatting nits
250274
@@ -287,7 +311,7 @@ index c4ce00489..1858b48dc 100755
287311### Commit these changes
288312
289313``` shell
290- git commit -m" Manually update READMEs, quickstart, and top-level stuff" .
314+ git commit -m " Manually update READMEs, quickstart, and top-level stuff" .
291315```
292316
293317## Expanding a library
0 commit comments