diff options
author | Dan O'Reilly <oreilldf@gmail.com> | 2015-08-12 23:57:46 -0400 |
---|---|---|
committer | Dan O'Reilly <oreilldf@gmail.com> | 2015-08-12 23:57:46 -0400 |
commit | e47cdd5a559f488ba52756927ce68f4cf93874fa (patch) | |
tree | 8ce2723e822808baf58e96f569c86035717ea351 /generate_descriptor_proto.sh | |
parent | daeaa6a28b81195f24d89222e649d79c9555af8b (diff) | |
parent | 38a56ee4b19d72c2e9d81a08b018704d1addf561 (diff) | |
download | protobuf-e47cdd5a559f488ba52756927ce68f4cf93874fa.tar.gz protobuf-e47cdd5a559f488ba52756927ce68f4cf93874fa.tar.bz2 protobuf-e47cdd5a559f488ba52756927ce68f4cf93874fa.zip |
Merge remote-tracking branch 'upstream/master' into py2_py3_straddle
Conflicts:
python/google/protobuf/descriptor_pool.py
python/google/protobuf/internal/api_implementation_default_test.py
python/google/protobuf/internal/cpp_message.py
python/google/protobuf/internal/descriptor_database_test.py
python/google/protobuf/internal/descriptor_pool_test.py
python/google/protobuf/internal/descriptor_python_test.py
python/google/protobuf/internal/descriptor_test.py
python/google/protobuf/internal/generator_test.py
python/google/protobuf/internal/message_factory_python_test.py
python/google/protobuf/internal/message_factory_test.py
python/google/protobuf/internal/message_test.py
python/google/protobuf/internal/proto_builder_test.py
python/google/protobuf/internal/python_message.py
python/google/protobuf/internal/reflection_test.py
python/google/protobuf/internal/service_reflection_test.py
python/google/protobuf/internal/symbol_database_test.py
python/google/protobuf/internal/text_encoding_test.py
python/google/protobuf/internal/text_format_test.py
python/google/protobuf/internal/unknown_fields_test.py
python/google/protobuf/internal/wire_format_test.py
python/google/protobuf/pyext/descriptor_cpp2_test.py
python/google/protobuf/pyext/message_factory_cpp2_test.py
python/google/protobuf/pyext/reflection_cpp2_generated_test.py
python/setup.py
ruby/lib/google/protobuf/message_exts.rb
Diffstat (limited to 'generate_descriptor_proto.sh')
-rwxr-xr-x | generate_descriptor_proto.sh | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/generate_descriptor_proto.sh b/generate_descriptor_proto.sh index 07219dc1..b6e6e07b 100755 --- a/generate_descriptor_proto.sh +++ b/generate_descriptor_proto.sh @@ -27,7 +27,68 @@ __EOF__ fi cd src -make $@ protoc && - ./protoc --cpp_out=dllexport_decl=LIBPROTOBUF_EXPORT:. google/protobuf/descriptor.proto && \ - ./protoc --cpp_out=dllexport_decl=LIBPROTOC_EXPORT:. google/protobuf/compiler/plugin.proto + +declare -a RUNTIME_PROTO_FILES=(\ + google/protobuf/any.proto \ + google/protobuf/api.proto \ + google/protobuf/descriptor.proto \ + google/protobuf/duration.proto \ + google/protobuf/empty.proto \ + google/protobuf/field_mask.proto \ + google/protobuf/source_context.proto \ + google/protobuf/struct.proto \ + google/protobuf/timestamp.proto \ + google/protobuf/type.proto \ + google/protobuf/wrappers.proto) + +CORE_PROTO_IS_CORRECT=0 +PROCESS_ROUND=1 +echo "Updating descriptor protos..." +while [ $CORE_PROTO_IS_CORRECT -ne 1 ] +do + echo "Round $PROCESS_ROUND" + CORE_PROTO_IS_CORRECT=1 + for PROTO_FILE in ${RUNTIME_PROTO_FILES[@]}; do + BASE_NAME=${PROTO_FILE%.*} + cp ${BASE_NAME}.pb.h ${BASE_NAME}.pb.h.tmp + cp ${BASE_NAME}.pb.cc ${BASE_NAME}.pb.cc.tmp + done + cp google/protobuf/compiler/plugin.pb.h google/protobuf/compiler/plugin.pb.h.tmp + cp google/protobuf/compiler/plugin.pb.cc google/protobuf/compiler/plugin.pb.cc.tmp + + make $@ protoc && + ./protoc --cpp_out=dllexport_decl=LIBPROTOBUF_EXPORT:. ${RUNTIME_PROTO_FILES[@]} && \ + ./protoc --cpp_out=dllexport_decl=LIBPROTOC_EXPORT:. google/protobuf/compiler/plugin.proto + + for PROTO_FILE in ${RUNTIME_PROTO_FILES[@]}; do + BASE_NAME=${PROTO_FILE%.*} + diff ${BASE_NAME}.pb.h ${BASE_NAME}.pb.h.tmp > /dev/null + if test $? -ne 0; then + CORE_PROTO_IS_CORRECT=0 + fi + diff ${BASE_NAME}.pb.cc ${BASE_NAME}.pb.cc.tmp > /dev/null + if test $? -ne 0; then + CORE_PROTO_IS_CORRECT=0 + fi + done + + diff google/protobuf/compiler/plugin.pb.h google/protobuf/compiler/plugin.pb.h.tmp > /dev/null + if test $? -ne 0; then + CORE_PROTO_IS_CORRECT=0 + fi + diff google/protobuf/compiler/plugin.pb.cc google/protobuf/compiler/plugin.pb.cc.tmp > /dev/null + if test $? -ne 0; then + CORE_PROTO_IS_CORRECT=0 + fi + + for PROTO_FILE in ${RUNTIME_PROTO_FILES[@]}; do + BASE_NAME=${PROTO_FILE%.*} + rm ${BASE_NAME}.pb.h.tmp + rm ${BASE_NAME}.pb.cc.tmp + done + rm google/protobuf/compiler/plugin.pb.h.tmp + rm google/protobuf/compiler/plugin.pb.cc.tmp + + PROCESS_ROUND=$((PROCESS_ROUND + 1)) +done cd .. |