-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathTaskfile.yaml
79 lines (65 loc) · 1.89 KB
/
Taskfile.yaml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
version: 3
vars:
codegenJar: "../rmf-codegen/rmf-codegen.jar"
apiSpecsDir: "../commercetools-api-reference/api-specs"
generatedDir: "./generated"
versionId: 1.5.0
tasks:
install:
cmds:
- go install golang.org/x/tools/cmd/goimports@latest
test:
cmds:
- go test ./...
fmt:
cmds:
- go fmt ./...
coverage:
cmds:
- go test -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... ./...
- go tool cover -html=coverage.txt
generate:
cmds:
# - task: generate-checkout
- task: generate-connect
- task: generate-importapi
# - task: generate-frontend
# - task: generate-ml
- task: generate-platform
- task: generate-history
generate-checkout:
cmds:
- task: generate-api
vars: {apiName: checkout, path: checkout}
generate-connect:
cmds:
- task: generate-api
vars: {apiName: connect, path: connect}
generate-importapi:
cmds:
- task: generate-api
vars: {apiName: importapi, path: import}
generate-frontend:
cmds:
- task: generate-api
vars: {apiName: frontend, path: frontend-api}
generate-ml:
cmds:
- task: generate-api
vars: {apiName: ml, path: ml}
generate-platform:
cmds:
- task: generate-api
vars: {apiName: platform, path: api}
generate-history:
cmds:
- task: generate-api
vars: {apiName: history, path: history}
generate-api:
cmds:
- java -jar {{ .codegenJar }} generate {{ .apiSpecsDir }}/{{ .path }}/api.raml -b {{ .apiName }} -o {{ .generatedDir }}/ -t GO_CLIENT
- goimports -w {{ .generatedDir }}/{{ .apiName }}/
- go fmt {{ .generatedDir }}/{{ .apiName }}/
- rm -rf {{ .apiName }}/
- mv {{ .generatedDir }}/{{ .apiName }} .
- perl -p -i -e 's/const Version = "1.0.1"/const Version = "{{ .versionId }}"/' {{ .apiName }}/client.go