Stephane Barbarie | 3559506 | 2018-02-08 08:34:39 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | export SRC_DIR="$1" |
| 4 | |
| 5 | echo $SRC_DIR |
| 6 | |
| 7 | export MAPS=Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor |
| 8 | export INCS="\ |
| 9 | -I $SRC_DIR \ |
| 10 | -I $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis" |
| 11 | |
| 12 | export VOLTHA_PB="\ |
| 13 | $SRC_DIR/adapter.proto \ |
| 14 | $SRC_DIR/device.proto \ |
| 15 | $SRC_DIR/events.proto \ |
| 16 | $SRC_DIR/health.proto \ |
| 17 | $SRC_DIR/logical_device.proto \ |
| 18 | $SRC_DIR/ponsim.proto \ |
| 19 | $SRC_DIR/voltha.proto" |
| 20 | |
| 21 | export COMMON_PB="\ |
| 22 | $SRC_DIR/common.proto \ |
| 23 | $SRC_DIR/meta.proto \ |
| 24 | $SRC_DIR/yang_options.proto" |
| 25 | |
| 26 | export PONSIM_PB="$SRC_DIR/ponsim_common.proto $SRC_DIR/ponsim_olt.proto" |
| 27 | export SCHEMA_PB="$SRC_DIR/schema.proto" |
| 28 | export IETF_PB="$SRC_DIR/ietf_interfaces.proto" |
| 29 | export OF_PB="$SRC_DIR/openflow_13.proto" |
| 30 | export BAL_PB="$SRC_DIR/bal*.proto" |
| 31 | export BBF_PB="$SRC_DIR/bbf*.proto" |
Stephane Barbarie | c92b9e2 | 2018-04-17 10:11:19 -0400 | [diff] [blame] | 32 | export OMCI_PB="$SRC_DIR/omci*.proto" |
Stephane Barbarie | 3559506 | 2018-02-08 08:34:39 -0500 | [diff] [blame] | 33 | |
| 34 | export PB_VARS="\ |
| 35 | VOLTHA_PB \ |
| 36 | COMMON_PB \ |
| 37 | PONSIM_PB \ |
| 38 | SCHEMA_PB \ |
| 39 | IETF_PB \ |
| 40 | OF_PB \ |
| 41 | BAL_PB \ |
Stephane Barbarie | c92b9e2 | 2018-04-17 10:11:19 -0400 | [diff] [blame] | 42 | BBF_PB \ |
| 43 | OMCI_PB" |
Stephane Barbarie | 3559506 | 2018-02-08 08:34:39 -0500 | [diff] [blame] | 44 | |
| 45 | for pb_var in $PB_VARS |
| 46 | do |
| 47 | pbs="$(eval echo \$$pb_var)" |
| 48 | echo "Compiling $pbs" |
| 49 | protoc --go_out=$MAPS,plugins=grpc:$GOPATH/src $INCS $pbs |
| 50 | done |