-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_proto.sh
executable file
·57 lines (45 loc) · 1.3 KB
/
build_proto.sh
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
#!/bin/bash
# do_build_v2() {
# cwd=`pwd`
# cd ./apis
# mkdir -p cpp golang docs
# cur_dir=`pwd`
# src_dir="protocol/v2"
# cpp_dir=${cur_dir}/cpp/${src_dir}
# mkdir -p ${cpp_dir}
# cd ${src_dir}
# protoc \
# -I . \
# -I ${GOPATH}/src \
# -I ${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate \
# -I ${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway \
# -I ${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
# --grpc_out="${cpp_dir}" \
# --plugin="protoc-gen-grpc=/usr/local/bin/grpc_cpp_plugin" \
# --go_out="plugins=grpc:${cur_dir}/golang" \
# --cpp_out="${cpp_dir}" \
# --validate_out="lang=go:${cur_dir}/golang" \
# --validate_out="lang=cc:${cpp_dir}" \
# --grpc-gateway_out=logtostderr=true:${cur_dir}/golang \
# --swagger_out=logtostderr=true:${cur_dir}/docs \
# ./*.proto
# # protocol/v2/*.proto
# }
do_build_v1() {
cwd=`pwd`
cd ./apis
cur_dir=`pwd`
src_dir="protocol/v1"
cpp_dir=${cur_dir}/cpp/${src_dir}
mkdir -p ${cpp_dir}
cd ${src_dir}
protoc \
-I. \
--grpc_out="${cpp_dir}" \
--plugin="protoc-gen-grpc=/usr/local/bin/grpc_cpp_plugin" \
--cpp_out="${cpp_dir}" \
./*.proto
cd ${cwd}
}
do_build_v1
# do_build_v2