diff options
author | Alistair Veitch <aveitch@google.com> | 2016-05-26 10:29:38 -0700 |
---|---|---|
committer | Alistair Veitch <aveitch@google.com> | 2016-05-26 10:29:38 -0700 |
commit | 44181c02c4e80c404a2544f88c9542a15d8f3306 (patch) | |
tree | b0b79bf99f08be82b420b48f579a20032041e17b | |
parent | 3e97668d8266c8d20d4de78771bbd615a79b976d (diff) |
fix options file; fix generated include guards
-rw-r--r-- | build.yaml | 1 | ||||
-rw-r--r-- | src/core/ext/census/gen/census.pb.h | 4 | ||||
-rw-r--r-- | src/proto/census/census.options | 2 | ||||
m--------- | third_party/protobuf | 0 | ||||
-rwxr-xr-x | tools/codegen/core/gen_nano_proto.sh | 7 |
5 files changed, 11 insertions, 3 deletions
diff --git a/build.yaml b/build.yaml index 19e4b1adcd..bbd60cbe21 100644 --- a/build.yaml +++ b/build.yaml @@ -34,6 +34,7 @@ filegroups: plugin: census_grpc_plugin uses: - grpc_base + - nanopb - name: gpr_base public_headers: - include/grpc/support/alloc.h diff --git a/src/core/ext/census/gen/census.pb.h b/src/core/ext/census/gen/census.pb.h index fe263988c3..d040fe29e7 100644 --- a/src/core/ext/census/gen/census.pb.h +++ b/src/core/ext/census/gen/census.pb.h @@ -33,8 +33,8 @@ /* Automatically generated nanopb header */ /* Generated by nanopb-0.3.5-dev */ -#ifndef PB_CENSUS_PB_H_INCLUDED -#define PB_CENSUS_PB_H_INCLUDED +#ifndef GRPC_CORE_EXT_CENSUS_GEN_CENSUS_PB_H +#define GRPC_CORE_EXT_CENSUS_GEN_CENSUS_PB_H #include "third_party/nanopb/pb.h" #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/proto/census/census.options b/src/proto/census/census.options index 08ebbc071b..a1f80395c7 100644 --- a/src/proto/census/census.options +++ b/src/proto/census/census.options @@ -1,3 +1,3 @@ google.census.Tag.key max_size:255 google.census.Tag.value max_size:255 -google.census.View.tag_keys max_count 15 +google.census.View.tag_key max_count:15 diff --git a/third_party/protobuf b/third_party/protobuf -Subproject 3470b6895aa659b7559ed678e029a5338e535f1 +Subproject a1938b2aa9ca86ce7ce50c27ff9737c1008d2a0 diff --git a/tools/codegen/core/gen_nano_proto.sh b/tools/codegen/core/gen_nano_proto.sh index b216a20379..c880fc23a2 100755 --- a/tools/codegen/core/gen_nano_proto.sh +++ b/tools/codegen/core/gen_nano_proto.sh @@ -136,6 +136,13 @@ 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" +# 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" + # prepend copyright TMPFILE=$(mktemp) cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" > $TMPFILE |