-
Notifications
You must be signed in to change notification settings - Fork 2
/
Taskfile.yml
31 lines (29 loc) · 960 Bytes
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
version: 3
vars:
GEN_OUT_DIR: handler
tasks:
fmt-imports:
# macOS requires to install GNU sed first. Use `brew install gnu-sed` to install it.
# It has to be added to PATH as `sed` command, to replace default BSD sed.
# See `brew info gnu-sed` for more details on how to add it to PATH.
# /^import ($$/: starts with "import ("
# /^)/: ends with ")"
# /^[[:space:]]*$$/: empty lines
cmds:
- find . -type f -name '*.go' -exec sed -i '/^import ($$/,/^)/ {/^[[:space:]]*$$/d}' {} +
- goimports -local "github.com/aiven/go-client-codegen" -w .
get-openapi-spec:
cmds:
- curl -s -o openapi.json https://api.aiven.io/doc/openapi.json
go-generate:
cmds:
- rm -rf {{.GEN_OUT_DIR}}
- GEN_OUT_DIR={{.GEN_OUT_DIR}} go run -tags=generator ./generator/...
- task: fmt-imports
generate:
cmds:
- task: get-openapi-spec
- task: go-generate
test:
cmds:
- go test -v