on develop help sign in
Expanding generator notes
038dc68Brendan Hay
README.md+14−6
@@ -26,9 +26,10 @@ To add a new endpoint, first create its annex file in the annex directory. It sh
26
26
27### Example:
27### Example:
28
28
29−#### Want to generate the Cloud Dataproc API endpoint
29+#### Generating the Cloud Dataproc API
30
30
31+The Cloud Dataproc API is called `dataproc-api.json` in the Google Discovery API.
31−The Cloud Dataproc API is called dataproc-api.json in the google repo. Create the file gogol/gen/annex/dataproc.json with these contents:
32+Create the file `./gen/annex/dataproc.json` with these contents:
32
33
33```
34```
34{
35{
@@ -37,18 +38,25 @@ The Cloud Dataproc API is called dataproc-api.json in the google repo. Create th
37}
38}
38```
39```
39
40
40−From the gogol/gen directory, run:
41+From the `./gen` directory, run:
41
42
42```
43```
43make clean
44make clean
44make
45make
45```
46```
46
47
47−This will build the gogol-gen executable, and then will generate all the API endpoints that have annex files.
48+This will build the `./gen/bin/gogol-gen` executable, and then will generate libraries
49+for all APIs that have matching `./gen/annex/*.json` configuration.
48
50
49−Once completed, there would then be a gogol-dataproc directory with its corresponding generated API client in the top-level directory of the repo.
51+Once completed, the result would be a `./gogol-dataproc` directory containing the
52+generated API client.
53+
54+`make full-clean` can be used to cause a complete re-download of all (including new)
55+service models.
56+
57+Individual libraries can be generated by passing a specific `MODELS` environment
58+variable to the `make` command, for example: `MODELS=model/admin/directory/v1/admin-api.json make`
50
59
51−Note: rather than `make clean`, one could run `make full-clean` which removes all of the API references and causes redownload of the google-api-go-client repo.
52
60
53## Contribute
61## Contribute
54
62