@@ -9,13 +9,9 @@ _default:
99_ clear :
1010 @ -clear
1111
12-
1312# Build all API clients by executing the build steps for each language.
1413[group (' build' )]
15- build : _clear \
16- _build-python-preprocess _build-rust-preprocess _build-typescript-preprocess \
17- _build_call \
18- _build-python-postprocess _build-rust-postprocess _build-typescript-postprocess
14+ build : _clear _build-python-preprocess _build-rust-preprocess _build-typescript-preprocess _build_call _build-python-postprocess _build-rust-postprocess _build-typescript-postprocess
1915
2016_ build_call generator = " ":
2117 {{ OPENAPI_GENERATOR_CLI }} generate {{ if generator == " " { " " } else { " --generator-key " + generator } }}
@@ -43,12 +39,13 @@ _build-python-postprocess:
4339
4440# Build the API clients for TypeScript by generating code with the OpenAPI Generator and applying post-processing steps. Also install npm dependencies and set up .gitignore.
4541[group (' build' )]
46- build-typescript : _clear (_build_call " typescript" ) _build-typescript-postprocess
42+ build-typescript : _clear _build-typescript-preprocess (_build_call " typescript" ) _build-typescript-postprocess
4743
4844# Remove some directories because they are not be overwritten by the generator.
4945_ build-typescript-preprocess :
5046 rm -rf \
5147 typescript/ src \
48+ typescript/ docs \
5249 typescript/ dist \
5350 typescript/ node_modules \
5451 typescript/ diffs
@@ -69,6 +66,9 @@ build-rust: _clear _build-rust-preprocess (_build_call "rust") _build-rust-postp
6966
7067_ build-rust-preprocess :
7168 rm -rf \
69+ rust/ src/ apis \
70+ rust/ src/ models \
71+ rust/ docs \
7272 rust/ diffs
7373
7474_ build-rust-postprocess :
@@ -85,7 +85,8 @@ lint-openapi-spec: _clear
8585 - -recommend
8686
8787# Generate the OpenAPI Generator configuration files from the config.ini.
88- [group (' config' ), script(" python3" )]
88+ [group (' config' )]
89+ [script (" python3" )]
8990update-generator-configs :
9091 import configparser
9192 import json
@@ -122,8 +123,8 @@ update-generator-configs:
122123 print(" Generated OpenAPI Generator configuration for TypeScript, Python, and Rust." )
123124
124125# Update the backend commit in the config.ini and increment the version.
125- [group (' config' )]
126126[arg (" backendCommit" , long=" backendCommit" , help=" The commit hash of the backend for which to fetch the OpenAPI specification." )]
127+ [group (' config' )]
127128update-config backendCommit : _clear (_update-config backendCommit) update-generator-configs (fetch-openapi-spec backendCommit) lint-openapi-spec
128129
129130[script (" python3" )]
@@ -153,8 +154,8 @@ _update-config backendCommit:
153154 print(f " Updated {INI_FILE} with backendCommit={config['input']['backendCommit']} and version={config['general']['version']}." )
154155
155156# Fetch the OpenAPI specification for the given backend commit from the Geo Engine repository and save it to the input directory.
156- [group (' config' )]
157157[arg (" backendCommit" , long=" backendCommit" , help=" The commit hash of the backend for which to fetch the OpenAPI specification." )]
158+ [group (' config' )]
158159fetch-openapi-spec backendCommit :
159160 @ echo " Fetching OpenAPI specification for backend commit {{ backendCommit }} …"
160161 curl \
@@ -181,11 +182,11 @@ test: _clear test-python test-rust test-typescript
181182test-python : _clear
182183 #!/usr/bin/env bash
183184 python3 -m venv .venv && source .venv/bin/activate || source .venv/bin/activate
184-
185+
185186 python -m pip install --upgrade pip
186187 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
187188 if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
188-
189+
189190 pytest
190191
191192 [group (' test' )]
@@ -198,4 +199,4 @@ test-rust: _clear
198199[working-directory (" typescript" )]
199200test-typescript : _clear
200201 npm install
201- npm run build
202+ npm run build
0 commit comments