blob: 4c8ceaa5b59ca02da91495149cf44bb4f39131fe [file] [log] [blame]
Stephane Barbarie35595062018-02-08 08:34:39 -05001#!/bin/sh
Zack Williams41513bf2018-07-07 20:08:35 -07002# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Stephane Barbarie35595062018-02-08 08:34:39 -050015
16export SRC_DIR="$1"
17
18echo $SRC_DIR
19
20export MAPS=Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor
21export INCS="\
22 -I $SRC_DIR \
23 -I $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis"
24
25export VOLTHA_PB="\
26 $SRC_DIR/adapter.proto \
27 $SRC_DIR/device.proto \
28 $SRC_DIR/events.proto \
29 $SRC_DIR/health.proto \
30 $SRC_DIR/logical_device.proto \
31 $SRC_DIR/ponsim.proto \
32 $SRC_DIR/voltha.proto"
33
34export COMMON_PB="\
35 $SRC_DIR/common.proto \
36 $SRC_DIR/meta.proto \
37 $SRC_DIR/yang_options.proto"
38
39export PONSIM_PB="$SRC_DIR/ponsim_common.proto $SRC_DIR/ponsim_olt.proto"
40export SCHEMA_PB="$SRC_DIR/schema.proto"
41export IETF_PB="$SRC_DIR/ietf_interfaces.proto"
42export OF_PB="$SRC_DIR/openflow_13.proto"
43export BAL_PB="$SRC_DIR/bal*.proto"
44export BBF_PB="$SRC_DIR/bbf*.proto"
Stephane Barbariec92b9e22018-04-17 10:11:19 -040045export OMCI_PB="$SRC_DIR/omci*.proto"
Stephane Barbarie35595062018-02-08 08:34:39 -050046
47export PB_VARS="\
48 VOLTHA_PB \
49 COMMON_PB \
50 PONSIM_PB \
51 SCHEMA_PB \
52 IETF_PB \
53 OF_PB \
54 BAL_PB \
Stephane Barbariec92b9e22018-04-17 10:11:19 -040055 BBF_PB \
56 OMCI_PB"
Stephane Barbarie35595062018-02-08 08:34:39 -050057
58for pb_var in $PB_VARS
59do
60 pbs="$(eval echo \$$pb_var)"
61 echo "Compiling $pbs"
62 protoc --go_out=$MAPS,plugins=grpc:$GOPATH/src $INCS $pbs
63done