-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild_protos
More file actions
executable file
·36 lines (32 loc) · 1.2 KB
/
build_protos
File metadata and controls
executable file
·36 lines (32 loc) · 1.2 KB
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
#!/usr/bin/env bash
set -ex
if [ -z "$GOPATH" ]; then
echo "GOPATH env is required"
exit 1
fi
mappings=(
"google/api/annotations.proto=github.com/gogo/googleapis/google/api"
"google/api/http.proto=github.com/gogo/googleapis/google/api"
"google/rpc/code.proto=github.com/gogo/googleapis/google/rpc"
"google/rpc/error_details.proto=github.com/gogo/googleapis/google/rpc"
"google/rpc/status.proto=github.com/gogo/googleapis/google/rpc"
"google/protobuf/any.proto=github.com/gogo/protobuf/types"
"google/protobuf/duration.proto=github.com/gogo/protobuf/types"
"google/protobuf/empty.proto=github.com/gogo/protobuf/types"
"google/protobuf/struct.proto=github.com/gogo/protobuf/types"
"google/protobuf/timestamp.proto=github.com/gogo/protobuf/types"
"google/protobuf/wrappers.proto=github.com/gogo/protobuf/types"
"gogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto"
)
for mapping in "${mappings[@]}"
do
gogoarg+=",M$mapping"
done
protoc \
-I protos \
-I="vendor/github.com/gogo/protobuf" \
-I="vendor/github.com/gogo/protobuf/protobuf" \
-I="vendor/github.com/lyft/protoc-gen-validate" \
--gofast_out="plugins=grpc${gogoarg}:." \
--validate_out="lang=gogo:." \
protos/v1/config.proto