Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
f3b7af24
Commit
f3b7af24
authored
Sep 04, 2019
by
Rafi Kamal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change update_version to update the generated code
parent
bc1773c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
update_version.py
update_version.py
+24
-0
No files found.
update_version.py
View file @
f3b7af24
...
...
@@ -128,6 +128,7 @@ def UpdateCpp():
'static const int kMinHeaderVersionForProtoc =
%
s;'
%
cpp_version
,
line
)
return
line
def
RewritePortDef
(
line
):
line
=
re
.
sub
(
r'^#define PROTOBUF_VERSION .*$'
,
...
...
@@ -148,8 +149,31 @@ def UpdateCpp():
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
)
return
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/type.pb.h'
,
RewritePbH
)
RewriteTextFile
(
'src/google/protobuf/wrappers.pb.h'
,
RewritePbH
)
RewriteTextFile
(
'src/google/protobuf/compiler/plugin.pb.h'
,
RewritePbH
)
def
UpdateCsharp
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment