Skip to content

Commit 2ac86de

Browse files
authored
docs: explain default generation config in README.md (#3388)
1 parent 1080de4 commit 2ac86de

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

hermetic_build/README.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,36 @@ for additional instructions.
1818

1919
## Prerequisites
2020

21-
In order to generate a version for each library, a versions.txt has to exist
21+
### Generation configuration
22+
23+
A generation configuration file is required to generate GAPIC Client Libraries.
24+
25+
Please refer to [Generation configuration yaml](#generation-configuration-yaml--generation-config-path---optional)
26+
for more information.
27+
28+
### versions.txt
29+
30+
In order to generate a version for each library, a `versions.txt` has to exist
2231
in `repository-path`.
2332
Please refer to [Repository path](#repository-path--repositorypath---optional)
2433
for more information.
2534

2635
## Parameters to generate a repository using the docker image
2736

28-
### Generation configuration yaml (`generation-config-path`)
37+
### Generation configuration yaml (`generation-config-path`), optional
2938

3039
An absolute or relative path to a configuration file containing parameters to
3140
generate the repository.
3241
Please refer to [Configuration to generate a repository](#configuration-to-generate-a-repository)
3342
for more information.
3443

44+
The default value is `$(pwd)/generation_config.yaml`, i.e., `generation_config.yaml`
45+
in the current working directory.
46+
47+
This will raise `FileNotFoundError` if the specified generation config does not
48+
exist or, in case `generation-config-path` is not specified, the default
49+
generation config does not exist.
50+
3551
### Repository path (`repository-path`), optional
3652

3753
The path to where the generated repository goes.
@@ -41,8 +57,8 @@ For example, `cd google-cloud-java && python /path/to/entry_point.py ...` withou
4157
specifying the `--repository_path` option will modify the `google-cloud-java`
4258
repository the user `cd`'d into.
4359

44-
Note that versions.txt has to exist in `repository_path` in order to generate
45-
right version for each library.
60+
Note that `versions.txt` has to exist in `repository_path` in order to generate
61+
the right version for each library.
4662
Please refer [here](go/java-client-releasing#versionstxt-manifest) for more info
4763
of versions.txt.
4864

hermetic_build/library_generation/cli/entry_point.py

+8-18
Original file line numberDiff line numberDiff line change
@@ -78,28 +78,18 @@ def generate(
7878
api_definitions_path: str,
7979
):
8080
"""
81-
Compare baseline generation config and current generation config and
82-
generate changed libraries based on current generation config.
81+
Generate libraries based on a generation config.
8382
84-
If baseline generation config is not specified but current generation
85-
config is specified, generate all libraries if `library_names` is not
86-
specified, based on current generation config.
87-
88-
If current generation config is not specified but baseline generation
89-
config is specified, raise FileNotFoundError because current generation
90-
config should be the source of truth of library generation.
91-
92-
If both baseline generation config and current generation config are not
93-
specified, generate all libraries based on the default generation config,
94-
which is generation_config.yaml in the current working directory.
83+
If the `generation-config-path` is not specified the default generation
84+
config, `$(pwd)/generation_config.yaml`, will be used.
9585
9686
If `library_names` is specified, only libraries whose name can be found in
97-
the current generation config or default generation config, if current
98-
generation config is not specified, will be generated. Changed libraries
99-
will be ignored even if baseline and current generation config are
100-
specified.
87+
the generation config will be generated; otherwise all libraries in the
88+
generation config will be generated.
10189
102-
Raise FileNotFoundError if the default config does not exist.
90+
:raise FileNotFoundError if the specified generation config does not exist
91+
or, in case `generation-config-path` is not specified, the default
92+
generation config does not exist.
10393
"""
10494
__generate_repo_impl(
10595
generation_config_path=generation_config_path,

0 commit comments

Comments
 (0)