diff --git a/teaspoons-cli/README.md b/teaspoons-cli/README.md new file mode 100644 index 00000000..973311f6 --- /dev/null +++ b/teaspoons-cli/README.md @@ -0,0 +1,15 @@ +# Teaspoons CLI + +## Python thin client auto-generation +We use the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) to generate the "thin" Python client, +which is then used to build the Python-based "thick" CLI tool. + +To generate the Python thin client, run the following command: +```bash +./gradlew :teaspoons-cli:openApiGenerate +``` + +This will produce generated files at `/teaspoons-cli/build/`. + +Note we do not run the openApiGenerate task as part of the main Teaspoons build, as it is not necessary for the +service itself and we don't want any potential bugs in the CLI to affect the service. diff --git a/teaspoons-cli/teaspoons-client.gradle b/teaspoons-cli/teaspoons-client.gradle index 30da3d8a..223e8b73 100644 --- a/teaspoons-cli/teaspoons-client.gradle +++ b/teaspoons-cli/teaspoons-client.gradle @@ -8,8 +8,8 @@ tasks.openApiGenerate { configOptions.put("httpUserAgent", "teaspoons-client/0.0.0/python") } -// because we're building this Python client in a Java project, we add this so that the Python gets generated when we build the project -compileJava.dependsOn tasks.openApiGenerate +// we do NOT want to build this project when building the main service project, to prevent a bug in the cli code from breaking the main service build +//compileJava.dependsOn tasks.openApiGenerate task customCleanUp(type:Delete) { delete "${rootDir}/teaspoons-cli/build/"