14 lines
471 B
Bash
14 lines
471 B
Bash
|
|
# 由于goctl 不能编译多个proto文件,所以先要安装合并工具:
|
|||
|
|
# go install git.apinb.com/bsm-tools/proto-merge@v0.0.3
|
|||
|
|
|
|||
|
|
# 1. 先合并
|
|||
|
|
proto-merge ./proto/*.proto ./proto/delivery.proto
|
|||
|
|
|
|||
|
|
# 2. goctl 生成代码至/gen
|
|||
|
|
goctl rpc protoc ./proto/delivery.proto --go_out=./external/pb --go-grpc_out=./external/pb --zrpc_out=./ -m --style go_zero
|
|||
|
|
|
|||
|
|
# 3. 清理无用文件
|
|||
|
|
rm ./proto/delivery.proto
|
|||
|
|
mv ./client ./external/
|
|||
|
|
rm delivery.go
|
|||
|
|
rm ./etc/delivery.yaml
|