From 5d4e58c4c2c686f169fe7b0cd4fbcebdfdbadb0e Mon Sep 17 00:00:00 2001 From: Hao Nguyen Date: Mon, 29 Apr 2019 16:52:33 -0700 Subject: [PATCH] Change update_version to update the generated codes too --- update_version.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/update_version.py b/update_version.py index 4450854cc2..09d7865a5d 100755 --- a/update_version.py +++ b/update_version.py @@ -147,8 +147,29 @@ def UpdateCpp(): '#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION %s' % cpp_version, line) return line + def RewritePbH(line): + line = re.sub( + r'^#if PROTOBUF_VERSION < .*$', + '#if PROTOBUF_VERSION < %s' % cpp_version, + line) + line = re.sub( + r'^#if .* < PROTOBUF_MIN_PROTOC_VERSION$', + '#if %s < PROTOBUF_MIN_PROTOC_VERSION' % cpp_version, + line) + RewriteTextFile('src/google/protobuf/stubs/common.h', RewriteCommon) RewriteTextFile('src/google/protobuf/port_def.inc', RewritePortDef) + RewriteTextFile('src/google/protobuf/any.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/api.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/descriptor.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/duration.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/empty.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/field_mask.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/source_context.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/struct.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/timestamp.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/wrappers.pb.h', RewritePbH) + RewriteTextFile('src/google/protobuf/compiler/plugin.pb.h', RewritePbH) def UpdateCsharp():