on develop help sign in
Reworking README to be consistent with Amazonka

Including splitting the generator documentation into the ./gen subdirectory.

commit3e22577ab6abef433b342bd2c26abb9fdab33c82 authorBrendan Hay <brendan.g.hay@gmail.com> dateThu 24 Mar 2016, 10:18 (11 years ago) parent3dac194
2 files changed+78−27
README.md+26−27 gen/README.md+52
README.md+26−27
@@ -8,6 +8,9 @@ under heavy development and not intended for public consumption, caveat emptor!
88[![Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/brendanhay/gogol)
99
1010* [Description](#description)
11+* [Documentation](#documentation)
12+* [Organisation](#organisation)
13+* [Change Log](#change-log)
1114* [Contribute](#contribute)
1215* [Licence](#licence)
1316
@@ -17,45 +20,38 @@ under heavy development and not intended for public consumption, caveat emptor!
1720<img alt="Гоголь-моголь" height="261px;" src="https://upload.wikimedia.org/wikipedia/commons/c/c7/Kogel_mogel.JPG">
1821<img alt="Мико́ла Васи́льович Го́голь" height="261px" src="https://upload.wikimedia.org/wikipedia/commons/3/31/NV_Gogol.png">
1922
20−## Generate New API Endpoints
23+A comprehensive Google Services SDK for Haskell supporting all of the publicly
24+available services.
2125
22−To generate new API endpoints, use the gogol/gen directory.
23−The key files in this directory (outside of the actual gogol-gen source!) are the annex files.
26+An introductory blog post detailing the motivation can be found [here](http://brendanhay.nz/gogol-comprehensive-haskell-google-client).
2427
25−To add a new endpoint, first create its annex file in the annex directory. It should be named after the API endpoint as found in the <a href="https://www.github.com/google/google-api-go-client">google/google-api-go-client repo.</a>
28+## Documentation
2629
27−### Example:
30+You can find the latest stable release documentation for each respective library
31+on Hackage under the [Google section](http://hackage.haskell.org/packages/#cat:Google).
2832
29−#### Generating the Cloud Dataproc API
33+Haddock documentation which is built by CI from the `develop` branch
34+can be found [here](http://brendanhay.nz/gogol-doc).
3035
31−The Cloud Dataproc API is called `dataproc-api.json` in the Google Discovery API.
32−Create the file `./gen/annex/dataproc.json` with these contents:
3336
34−```
35−{
36− "library": "dataproc",
37− "canonicalName": "Dataproc"
38−}
39−```
37+## Organisation
4038
41−From the `./gen` directory, run:
39+This repository is organised into the following directory structure:
4240
43−```
44−make clean
45−make
46−```
41+* [`gogol`](gogol): Actual operational logic, you'll need to import this to send requests etc.
42+* `gogol-*`: Data types for each of the individual Amazon Web Service libraries.
43+* [`core`](core): The `gogol-core` library upon which each of the services depends.
44+* [`examples`](examples): A currently sparse collection of examples for the various services.
45+* [`gen`](gen): The code generation binary, along with configuration, templates, and assets.
46+* [`script`](script): CI scripts to manage the release lifecycle of the service libraries.
47+* [`share`](share): Makefile plumbing common to all service libraries
4748
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.
49+> See the `./gen` subdirectory for further details about generating an API client/SDK.
5050
51−Once completed, the result would be a `./gogol-dataproc` directory containing the
52−generated API client.
5351
54−`make full-clean` can be used to cause a complete re-download of all (including new)
55−service models.
52+## Change Log
5653
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`
54+A change log for the entire project can be found under [`gogol/CHANGELOG.md`](gogol/CHANGELOG.md).
5955
6056
6157## Contribute
@@ -66,3 +62,6 @@ For any problems, comments, or feedback please create an issue [here on GitHub](
6662## Licence
6763
6864Gogol is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
65+
66+Parts of the code are derived from AWS service descriptions, licensed under Apache 2.0.
67+Source files subject to this contain an additional licensing clause in their header.
gen/README.mdnew file+52
@@ -0,0 +1,52 @@
1+# gogol-gen
2+
3+For pull requests which affect generated output, please _do not include_ the
4+actual regenerated service code, only commit the updates to the generator,
5+config and annex connection.
6+
7+This ensures the Continuous Integration process is the single source of truth
8+for generated code changes, and keeps pull requests readable and focused on
9+actual generator code/logic changes.
10+
11+## Generating
12+
13+The configuration for the generation step of each individual service endpoint lives
14+under `./annex`. The naming matches the Google Discovery Service naming of endpoints,
15+which are vendored under `./model`.
16+
17+Rather than actually crawling the Discovery Service, the [Google API Go Client](https://www.github.com/google/google-api-go-client)
18+is vendored under `./vendor`, and the JSON service definitions are copied to `./model`
19+to ensure reproducibility of the generation steps and the abilitry to diff across versions.
20+
21+### Example: Cloud Dataproc
22+
23+To add a new endpoint, first create the related JSON configuration in the `./annex` directory.
24+
25+Since the Cloud Dataproc API is called `dataproc-api.json` in the Google Discovery API,
26+you would create the configuration `./annex/dataproc.json` with the following contents:
27+
28+```
29+{
30+ "library": "dataproc",
31+ "canonicalName": "Dataproc"
32+}
33+```
34+
35+Then, the `Makefile` is used:
36+
37+```
38+make clean
39+make
40+```
41+
42+This will build the `./bin/gogol-gen` binary, and will generate a Haskell library
43+for each API that has matching `./annex/*.json` configuration.
44+
45+For the above example, the result would be a `../gogol-dataproc` directory at the
46+top-level of the project containing the generated API client.
47+
48+> `make full-clean` can be used to cause a complete re-download of all (including new)
49+service models.
50+
51+> Individual clients/SDKs can be generated by passing a specific `MODELS` environment
52+variable to the `make` command, for example: `MODELS=model/admin/directory/v1/admin-api.json make`