forked from hootrhino/rulex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_proto.sh
executable file
·35 lines (34 loc) · 1.29 KB
/
gen_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
#! /bin/bash
# set Env path
export GOROOT=/usr/bin/go
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT:$GOPATH:$GOBIN
# Install protoc
# go get -u google.golang.org/grpc
# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
# go install google.golang.org/grpc/cmd/[email protected]
# RulexRpc
echo ">>> Generate RulexRpc Proto"
protoc -I ./rulexrpc --go_out=./rulexrpc --go_opt paths=source_relative \
--go-grpc_out=./rulexrpc --go-grpc_opt paths=source_relative \
./rulexrpc/grpc_source.proto
echo ">>> Generate RulexRpc Proto OK"
# Stream
echo ">>> Generate XStream Proto"
protoc -I ./xstream --go_out ./xstream --go_opt paths=source_relative \
--go-grpc_out=./xstream --go-grpc_opt paths=source_relative \
./xstream/xstream.proto
echo ">>> Generate Rpc Proto OK."
# Codec
echo ">>> Generate Codec Proto."
protoc -I ./rulexrpc --go_out ./rulexrpc --go_opt paths=source_relative \
--go-grpc_out=./rulexrpc --go-grpc_opt paths=source_relative \
./rulexrpc/xcodec.proto
echo ">>> Generate Codec Proto OK."
# Trailer
echo ">>> Generate Trailer Proto."
protoc -I ./trailer --go_out ./trailer --go_opt paths=source_relative \
--go-grpc_out=./trailer --go-grpc_opt paths=source_relative \
./trailer/trailer.proto
echo ">>> Generate Trailer Proto OK."