aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/codegen
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2018-06-21 15:15:10 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2018-06-21 17:46:31 -0700
commitf3955ba7119f8433fc6a0fba6cf1a075ea5a4f2a (patch)
tree6eb6da4d55b685d29e3aa7d88c5d1bcadf7d3f3f /tools/codegen
parentfd7683c7de14fd93f9696e3aee8abf51d64745b3 (diff)
Update to use the canonical version of LB proto
Diffstat (limited to 'tools/codegen')
-rwxr-xr-xtools/codegen/core/gen_nano_proto.sh21
1 files changed, 3 insertions, 18 deletions
diff --git a/tools/codegen/core/gen_nano_proto.sh b/tools/codegen/core/gen_nano_proto.sh
index c56429a320..5c781761ba 100755
--- a/tools/codegen/core/gen_nano_proto.sh
+++ b/tools/codegen/core/gen_nano_proto.sh
@@ -68,29 +68,14 @@ popd
# this should be the same version as the submodule we compile against
# ideally we'd update this as a template to ensure that
-pip install protobuf==3.5.0.post1
+pip install protobuf==3.5.2
pushd "$(dirname $INPUT_PROTO)" > /dev/null
protoc \
--plugin=protoc-gen-nanopb="$GRPC_ROOT/third_party/nanopb/generator/protoc-gen-nanopb" \
---nanopb_out='-T -L#include\ \"pb.h\"'":$OUTPUT_DIR" "$(basename $INPUT_PROTO)"
-
-readonly PROTO_BASENAME=$(basename $INPUT_PROTO .proto)
-sed -i "s:$PROTO_BASENAME.pb.h:${GRPC_OUTPUT_DIR}/$PROTO_BASENAME.pb.h:g" \
- "$OUTPUT_DIR/$PROTO_BASENAME.pb.c"
-
-if [ $PROTO_BASENAME == "handshaker" ] || [ $PROTO_BASENAME == "altscontext" ]; then
- sed -i "s:transport_security_common.pb.h:${GRPC_OUTPUT_DIR}/transport_security_common.pb.h:g" \
- "$OUTPUT_DIR/$PROTO_BASENAME.pb.h"
-fi
-
-# Fix up the include guards such that they pass the check_include_guards.py
-# test. Assumes that the generated files are being placed in gRPC src dir.
-readonly INCLUDE_GUARD_BASE=`echo $GRPC_OUTPUT_DIR | tr [a-z/] [A-Z_] | sed s:^.*SRC_::`
-readonly UC_PROTO_BASENAME=`echo $PROTO_BASENAME | tr [a-z] [A-Z]`
-sed -i "s:PB_${UC_PROTO_BASENAME}_PB_H_INCLUDED:GRPC_${INCLUDE_GUARD_BASE}_${UC_PROTO_BASENAME}_PB_H:g" \
- "$OUTPUT_DIR/$PROTO_BASENAME.pb.h"
+--nanopb_out='-T -Q#include\ \"'"${GRPC_OUTPUT_DIR}"'/%s\" -L#include\ \"pb.h\"'":$OUTPUT_DIR" \
+"$(basename $INPUT_PROTO)"
deactivate
rm -rf $VENV_DIR