Skip to content

Commit

Permalink
don't build python with project; add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mmorgantaylor committed Sep 23, 2024
1 parent 0a117db commit 170d37c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions teaspoons-cli/README.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions teaspoons-cli/teaspoons-client.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down

0 comments on commit 170d37c

Please sign in to comment.