diff --git a/hermetic_build/README.md b/hermetic_build/README.md index 583e766bdf..c9ef8c6184 100644 --- a/hermetic_build/README.md +++ b/hermetic_build/README.md @@ -18,20 +18,36 @@ for additional instructions. ## Prerequisites -In order to generate a version for each library, a versions.txt has to exist +### Generation configuration + +A generation configuration file is required to generate GAPIC Client Libraries. + +Please refer to [Generation configuration yaml](#generation-configuration-yaml--generation-config-path---optional) +for more information. + +### versions.txt + +In order to generate a version for each library, a `versions.txt` has to exist in `repository-path`. Please refer to [Repository path](#repository-path--repositorypath---optional) for more information. ## Parameters to generate a repository using the docker image -### Generation configuration yaml (`generation-config-path`) +### Generation configuration yaml (`generation-config-path`), optional An absolute or relative path to a configuration file containing parameters to generate the repository. Please refer to [Configuration to generate a repository](#configuration-to-generate-a-repository) for more information. +The default value is `$(pwd)/generation_config.yaml`, i.e., `generation_config.yaml` +in the current working directory. + +This will raise `FileNotFoundError` if the specified generation config does not +exist or, in case `generation-config-path` is not specified, the default +generation config does not exist. + ### Repository path (`repository-path`), optional 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 specifying the `--repository_path` option will modify the `google-cloud-java` repository the user `cd`'d into. -Note that versions.txt has to exist in `repository_path` in order to generate -right version for each library. +Note that `versions.txt` has to exist in `repository_path` in order to generate +the right version for each library. Please refer [here](go/java-client-releasing#versionstxt-manifest) for more info of versions.txt. diff --git a/hermetic_build/library_generation/cli/entry_point.py b/hermetic_build/library_generation/cli/entry_point.py index e568f831ab..1d0e9f7de9 100644 --- a/hermetic_build/library_generation/cli/entry_point.py +++ b/hermetic_build/library_generation/cli/entry_point.py @@ -78,28 +78,18 @@ def generate( api_definitions_path: str, ): """ - Compare baseline generation config and current generation config and - generate changed libraries based on current generation config. + Generate libraries based on a generation config. - If baseline generation config is not specified but current generation - config is specified, generate all libraries if `library_names` is not - specified, based on current generation config. - - If current generation config is not specified but baseline generation - config is specified, raise FileNotFoundError because current generation - config should be the source of truth of library generation. - - If both baseline generation config and current generation config are not - specified, generate all libraries based on the default generation config, - which is generation_config.yaml in the current working directory. + If the `generation-config-path` is not specified the default generation + config, `$(pwd)/generation_config.yaml`, will be used. If `library_names` is specified, only libraries whose name can be found in - the current generation config or default generation config, if current - generation config is not specified, will be generated. Changed libraries - will be ignored even if baseline and current generation config are - specified. + the generation config will be generated; otherwise all libraries in the + generation config will be generated. - Raise FileNotFoundError if the default config does not exist. + :raise FileNotFoundError if the specified generation config does not exist + or, in case `generation-config-path` is not specified, the default + generation config does not exist. """ __generate_repo_impl( generation_config_path=generation_config_path,