forked from kwilteam/kwil-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile-pb.yml
94 lines (88 loc) · 3.87 KB
/
Taskfile-pb.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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
version: '3'
tasks:
compile:
cmds:
- task: tx:v1
- task: tx:v1:swagger
- task: admin:v0
- task: function:v0
- task: function:v0:swagger
tx:v1:
desc: Compiles TxService v1 protobuf
preconditions:
- sh: a="libprotoc 23.4";b=`protoc --version`;test "$a" = "$b"
msg: "Protobuf compiler version is not 23.4, please install the correct version"
cmds:
- |
protoc -I ./proto \
--go_out=. --go_opt module=github.com/kwilteam/kwil-db \
--go-grpc_out=. --go-grpc_opt module=github.com/kwilteam/kwil-db \
--grpc-gateway_out=. --grpc-gateway_opt module=github.com/kwilteam/kwil-db \
--grpc-gateway_opt generate_unbound_methods=true \
--openapiv2_out=internal/services/http/api/tx \
--openapiv2_opt allow_merge=true --openapiv2_opt merge_file_name=v1 \
proto/kwil/tx/v1/*.proto
sources:
- proto/kwil/tx/v1/*.proto
generates:
- core/rpc/protobuf/tx/v1/*.go
- internal/services/http/api/tx/v1.swagger.json
tx:v1:swagger: # more general for all platforms
desc: Generates swagger codegen for TxService v1
cmds:
# if swagger-codegen-cli.jar does not exist, download it
- test -f swagger-codegen-cli.jar || wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.51/swagger-codegen-cli-3.0.51.jar -O swagger-codegen-cli.jar
- java -jar swagger-codegen-cli.jar generate -i internal/services/http/api/tx/v1.swagger.json -l go -o core/rpc/http/tx
sources:
- internal/services/http/api/tx/v1.swagger.json
generates:
- core/rpc/http/tx/*
admin:v0:
desc: Compiles admin v0 protobuf
preconditions:
- sh: a="libprotoc 23.4";b=`protoc --version`;test "$a" = "$b"
msg: "Protobuf compiler version is not 23.4, please install the correct version"
cmds:
- |
protoc -I ./proto \
--go_out=. --go_opt module=github.com/kwilteam/kwil-db \
--go-grpc_out=. --go-grpc_opt module=github.com/kwilteam/kwil-db \
proto/kwil/admin/v0/*.proto
sources:
- proto/kwil/admin/v0/*.proto
generates:
- core/rpc/protobuf/admin/v0/*.go
function:v0:
desc: Compiles functions v0 protobuf
preconditions:
- sh: a="libprotoc 23.4";b=`protoc --version`;test "$a" = "$b"
msg: "Protobuf compiler version is not 23.4, please install the correct version"
cmds:
- |
protoc -I ./proto \
--go_out=. --go_opt module=github.com/kwilteam/kwil-db \
--go-grpc_out=. --go-grpc_opt module=github.com/kwilteam/kwil-db \
--grpc-gateway_out=. --grpc-gateway_opt module=github.com/kwilteam/kwil-db \
--grpc-gateway_opt generate_unbound_methods=true \
--openapiv2_out=internal/services/http/api/function \
--openapiv2_opt allow_merge=true --openapiv2_opt merge_file_name=v0 \
proto/kwil/function/v0/*.proto
sources:
- proto/kwil/function/v0/*.proto
generates:
- core/rpc/protobuf/function/v0/*.go
- internal/services/http/api/function/v0.swagger.json
# - internal/services/http/api/function/v0.swagger.json
# put in cmds
# --openapiv2_out=internal/services/http/api/function \
# --openapiv2_opt allow_merge=true --openapiv2_opt merge_file_name=v1 \
function:v0:swagger: # more general for all platforms
desc: Generates swagger codegen for TxService v1
cmds:
# if swagger-codegen-cli.jar does not exist, download it
- test -f swagger-codegen-cli.jar || wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.51/swagger-codegen-cli-3.0.51.jar -O swagger-codegen-cli.jar
- java -jar swagger-codegen-cli.jar generate -i internal/services/http/api/function/v0.swagger.json -l go -o core/rpc/http/function
sources:
- internal/services/http/api/function/v0.swagger.json
generates:
- core/rpc/http/function/*