2020-10-15 21:31:50 +08:00
|
|
|
#!/usr/bin/env bash
|
2020-10-19 10:36:40 +08:00
|
|
|
SCRIPTS_DIR=$(dirname "$0")
|
2020-10-15 21:31:50 +08:00
|
|
|
|
2020-10-24 11:36:42 +08:00
|
|
|
PROTO_DIR=$SCRIPTS_DIR/../internal/proto/
|
2020-10-19 10:36:40 +08:00
|
|
|
|
|
|
|
PROGRAM=$(basename "$0")
|
|
|
|
GOPATH=$(go env GOPATH)
|
|
|
|
|
|
|
|
if [ -z $GOPATH ]; then
|
|
|
|
printf "Error: the environment variable GOPATH is not set, please set it before running %s\n" $PROGRAM > /dev/stderr
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
export PATH=${GOPATH}/bin:$PATH
|
|
|
|
echo `which protoc-gen-go`
|
|
|
|
|
|
|
|
# official go code ship with the crate, so we need to generate it manually.
|
|
|
|
pushd ${PROTO_DIR}
|
|
|
|
|
2020-10-24 18:04:57 +08:00
|
|
|
mkdir -p commonpb
|
|
|
|
mkdir -p schemapb
|
|
|
|
mkdir -p etcdpb
|
|
|
|
mkdir -p internalpb
|
|
|
|
mkdir -p servicepb
|
|
|
|
mkdir -p masterpb
|
2020-12-10 17:55:55 +08:00
|
|
|
mkdir -p indexbuilderpb
|
2020-12-21 16:36:07 +08:00
|
|
|
mkdir -p indexcgopb
|
2020-12-21 10:06:46 +08:00
|
|
|
mkdir -p writerpb
|
2020-10-24 18:04:57 +08:00
|
|
|
|
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./commonpb common.proto
|
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./schemapb schema.proto
|
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./etcdpb etcd_meta.proto
|
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./internalpb internal_msg.proto
|
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./servicepb service_msg.proto
|
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./servicepb service.proto
|
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./masterpb master.proto
|
2020-12-10 17:55:55 +08:00
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./indexbuilderpb index_builder.proto
|
2020-12-21 16:36:07 +08:00
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./indexcgopb index_cgo_msg.proto
|
2020-12-21 10:06:46 +08:00
|
|
|
${protoc} --go_out=plugins=grpc,paths=source_relative:./writerpb write_node.proto
|
2020-10-19 10:36:40 +08:00
|
|
|
|
|
|
|
popd
|