2018-12-14 23:05:48 +00:00
|
|
|
#!/usr/bin/env python
|
2019-02-20 19:25:39 +00:00
|
|
|
# Usage: ./update_version.py <MAJOR>.<MINOR>.<MICRO> [<RC version>]
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
# ./update_version.py 3.7.1 2
|
|
|
|
# => Version will become 3.7.1-rc-2 (beta)
|
|
|
|
# ./update_version.py 3.7.1
|
|
|
|
# => Version will become 3.7.1 (stable)
|
2018-12-14 23:05:48 +00:00
|
|
|
|
|
|
|
import datetime
|
|
|
|
import re
|
|
|
|
import sys
|
|
|
|
from xml.dom import minidom
|
|
|
|
|
2019-02-20 19:25:39 +00:00
|
|
|
if len(sys.argv) < 2 or len(sys.argv) > 3:
|
2021-05-03 23:26:59 +00:00
|
|
|
print("""
|
2018-12-14 23:05:48 +00:00
|
|
|
[ERROR] Please specify a version.
|
|
|
|
|
2019-02-20 19:25:39 +00:00
|
|
|
./update_version.py <MAJOR>.<MINOR>.<MICRO> [<RC version>]
|
|
|
|
|
2018-12-14 23:05:48 +00:00
|
|
|
Example:
|
2019-02-20 19:25:39 +00:00
|
|
|
./update_version.py 3.7.1 2
|
2021-05-03 23:26:59 +00:00
|
|
|
""")
|
2018-12-14 23:05:48 +00:00
|
|
|
exit(1)
|
|
|
|
|
|
|
|
NEW_VERSION = sys.argv[1]
|
2019-09-18 20:30:03 +00:00
|
|
|
NEW_VERSION_INFO = [int(x) for x in NEW_VERSION.split('.')]
|
2018-12-14 23:05:48 +00:00
|
|
|
if len(NEW_VERSION_INFO) != 3:
|
2021-05-03 23:26:59 +00:00
|
|
|
print("""
|
2018-12-14 23:05:48 +00:00
|
|
|
[ERROR] Version must be in the format <MAJOR>.<MINOR>.<MICRO>
|
|
|
|
|
|
|
|
Example:
|
2019-02-20 19:25:39 +00:00
|
|
|
./update_version.py 3.7.3
|
2021-05-03 23:26:59 +00:00
|
|
|
""")
|
2018-12-14 23:05:48 +00:00
|
|
|
exit(1)
|
|
|
|
|
2019-09-18 20:30:03 +00:00
|
|
|
RC_VERSION = -1
|
2019-02-20 19:25:39 +00:00
|
|
|
if len(sys.argv) > 2:
|
|
|
|
RC_VERSION = int(sys.argv[2])
|
|
|
|
|
2018-12-14 23:05:48 +00:00
|
|
|
|
|
|
|
def Find(elem, tagname):
|
|
|
|
for child in elem.childNodes:
|
|
|
|
if child.nodeName == tagname:
|
|
|
|
return child
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
def FindAndClone(elem, tagname):
|
|
|
|
return Find(elem, tagname).cloneNode(True)
|
|
|
|
|
|
|
|
|
|
|
|
def ReplaceText(elem, text):
|
|
|
|
elem.firstChild.replaceWholeText(text)
|
|
|
|
|
|
|
|
|
2019-02-20 19:25:39 +00:00
|
|
|
def GetFullVersion(rc_suffix = '-rc-'):
|
2019-09-18 20:30:03 +00:00
|
|
|
if RC_VERSION < 0:
|
2019-02-20 19:25:39 +00:00
|
|
|
return NEW_VERSION
|
|
|
|
else:
|
|
|
|
return '%s%s%s' % (NEW_VERSION, rc_suffix, RC_VERSION)
|
|
|
|
|
|
|
|
|
2018-12-14 23:05:48 +00:00
|
|
|
def RewriteXml(filename, rewriter, add_xml_prefix=True):
|
|
|
|
document = minidom.parse(filename)
|
|
|
|
rewriter(document)
|
|
|
|
# document.toxml() always prepend the XML version without inserting new line.
|
|
|
|
# We wants to preserve as much of the original formatting as possible, so we
|
|
|
|
# will remove the default XML version and replace it with our custom one when
|
|
|
|
# whever necessary.
|
|
|
|
content = document.toxml().replace('<?xml version="1.0" ?>', '')
|
|
|
|
file_handle = open(filename, 'wb')
|
|
|
|
if add_xml_prefix:
|
2021-05-03 23:26:59 +00:00
|
|
|
file_handle.write(b'<?xml version="1.0" encoding="UTF-8"?>\n')
|
|
|
|
file_handle.write(content.encode('utf-8'))
|
|
|
|
file_handle.write(b'\n')
|
2018-12-14 23:05:48 +00:00
|
|
|
file_handle.close()
|
|
|
|
|
|
|
|
|
|
|
|
def RewriteTextFile(filename, line_rewriter):
|
|
|
|
lines = open(filename, 'r').readlines()
|
|
|
|
updated_lines = []
|
|
|
|
for line in lines:
|
|
|
|
updated_lines.append(line_rewriter(line))
|
|
|
|
if lines == updated_lines:
|
2021-05-03 23:26:59 +00:00
|
|
|
print('%s was not updated. Please double check.' % filename)
|
2018-12-14 23:05:48 +00:00
|
|
|
f = open(filename, 'w')
|
|
|
|
f.write(''.join(updated_lines))
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
|
|
|
|
def UpdateConfigure():
|
|
|
|
RewriteTextFile('configure.ac',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r'^AC_INIT\(\[Protocol Buffers\],\[.*\],\[protobuf@googlegroups.com\],\[protobuf\]\)$',
|
|
|
|
('AC_INIT([Protocol Buffers],[%s],[protobuf@googlegroups.com],[protobuf])'
|
2019-02-20 19:25:39 +00:00
|
|
|
% GetFullVersion()),
|
2018-12-14 23:05:48 +00:00
|
|
|
line))
|
|
|
|
|
|
|
|
|
|
|
|
def UpdateCpp():
|
2019-09-18 20:30:03 +00:00
|
|
|
cpp_version = '%d%03d%03d' % (
|
2018-12-14 23:05:48 +00:00
|
|
|
NEW_VERSION_INFO[0], NEW_VERSION_INFO[1], NEW_VERSION_INFO[2])
|
2020-08-19 18:32:03 +00:00
|
|
|
version_suffix = ''
|
|
|
|
if RC_VERSION != -1:
|
|
|
|
version_suffix = '-rc%s' % RC_VERSION
|
2019-03-26 16:30:12 +00:00
|
|
|
def RewriteCommon(line):
|
2018-12-14 23:05:48 +00:00
|
|
|
line = re.sub(
|
|
|
|
r'^#define GOOGLE_PROTOBUF_VERSION .*$',
|
|
|
|
'#define GOOGLE_PROTOBUF_VERSION %s' % cpp_version,
|
|
|
|
line)
|
2019-01-24 19:42:45 +00:00
|
|
|
line = re.sub(
|
|
|
|
r'^#define PROTOBUF_VERSION .*$',
|
|
|
|
'#define PROTOBUF_VERSION %s' % cpp_version,
|
|
|
|
line)
|
2020-08-19 18:32:03 +00:00
|
|
|
line = re.sub(
|
|
|
|
r'^#define GOOGLE_PROTOBUF_VERSION_SUFFIX .*$',
|
|
|
|
'#define GOOGLE_PROTOBUF_VERSION_SUFFIX "%s"' % version_suffix,
|
|
|
|
line)
|
|
|
|
line = re.sub(
|
|
|
|
r'^#define PROTOBUF_VERSION_SUFFIX .*$',
|
|
|
|
'#define PROTOBUF_VERSION_SUFFIX "%s"' % version_suffix,
|
|
|
|
line)
|
2019-09-18 20:30:03 +00:00
|
|
|
if NEW_VERSION_INFO[2] == 0:
|
2019-01-24 19:42:45 +00:00
|
|
|
line = re.sub(
|
|
|
|
r'^#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC .*$',
|
|
|
|
'#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC %s' % cpp_version,
|
|
|
|
line)
|
2018-12-14 23:05:48 +00:00
|
|
|
line = re.sub(
|
|
|
|
r'^#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION .*$',
|
|
|
|
'#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION %s' % cpp_version,
|
|
|
|
line)
|
|
|
|
line = re.sub(
|
|
|
|
r'^static const int kMinHeaderVersionForLibrary = .*$',
|
|
|
|
'static const int kMinHeaderVersionForLibrary = %s;' % cpp_version,
|
|
|
|
line)
|
|
|
|
line = re.sub(
|
|
|
|
r'^static const int kMinHeaderVersionForProtoc = .*$',
|
|
|
|
'static const int kMinHeaderVersionForProtoc = %s;' % cpp_version,
|
|
|
|
line)
|
|
|
|
return line
|
2020-08-19 18:32:03 +00:00
|
|
|
|
2019-03-26 16:30:12 +00:00
|
|
|
def RewritePortDef(line):
|
|
|
|
line = re.sub(
|
|
|
|
r'^#define PROTOBUF_VERSION .*$',
|
|
|
|
'#define PROTOBUF_VERSION %s' % cpp_version,
|
|
|
|
line)
|
2020-08-19 18:32:03 +00:00
|
|
|
line = re.sub(
|
|
|
|
r'^#define PROTOBUF_VERSION_SUFFIX .*$',
|
|
|
|
'#define PROTOBUF_VERSION_SUFFIX "%s"' % version_suffix,
|
|
|
|
line)
|
2019-09-18 20:30:03 +00:00
|
|
|
if NEW_VERSION_INFO[2] == 0:
|
2019-03-26 16:30:12 +00:00
|
|
|
line = re.sub(
|
|
|
|
r'^#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC .*$',
|
|
|
|
'#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC %s' % cpp_version,
|
|
|
|
line)
|
|
|
|
line = re.sub(
|
|
|
|
r'^#define PROTOBUF_MIN_PROTOC_VERSION .*$',
|
|
|
|
'#define PROTOBUF_MIN_PROTOC_VERSION %s' % cpp_version,
|
|
|
|
line)
|
|
|
|
line = re.sub(
|
|
|
|
r'^#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION .*$',
|
|
|
|
'#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION %s' % cpp_version,
|
|
|
|
line)
|
|
|
|
return line
|
2019-08-09 20:21:18 +00:00
|
|
|
|
2019-09-18 20:30:03 +00:00
|
|
|
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
|
|
|
|
|
2019-03-26 16:30:12 +00:00
|
|
|
RewriteTextFile('src/google/protobuf/stubs/common.h', RewriteCommon)
|
|
|
|
RewriteTextFile('src/google/protobuf/port_def.inc', RewritePortDef)
|
2019-09-18 20:30:03 +00:00
|
|
|
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)
|
2018-12-14 23:05:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
def UpdateCsharp():
|
|
|
|
RewriteXml('csharp/src/Google.Protobuf/Google.Protobuf.csproj',
|
|
|
|
lambda document : ReplaceText(
|
|
|
|
Find(Find(document.documentElement, 'PropertyGroup'), 'VersionPrefix'),
|
2019-05-09 13:14:32 +00:00
|
|
|
GetFullVersion(rc_suffix = '-rc')),
|
2018-12-14 23:05:48 +00:00
|
|
|
add_xml_prefix=False)
|
|
|
|
|
|
|
|
RewriteXml('csharp/Google.Protobuf.Tools.nuspec',
|
|
|
|
lambda document : ReplaceText(
|
|
|
|
Find(Find(document.documentElement, 'metadata'), 'version'),
|
2019-05-09 13:14:32 +00:00
|
|
|
GetFullVersion(rc_suffix = '-rc')))
|
2018-12-14 23:05:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
def UpdateJava():
|
|
|
|
RewriteXml('java/pom.xml',
|
|
|
|
lambda document : ReplaceText(
|
2019-02-20 19:25:39 +00:00
|
|
|
Find(document.documentElement, 'version'), GetFullVersion()))
|
2018-12-14 23:05:48 +00:00
|
|
|
|
2019-01-24 19:42:45 +00:00
|
|
|
RewriteXml('java/bom/pom.xml',
|
|
|
|
lambda document : ReplaceText(
|
2019-02-20 19:25:39 +00:00
|
|
|
Find(document.documentElement, 'version'), GetFullVersion()))
|
2019-01-24 19:42:45 +00:00
|
|
|
|
2018-12-14 23:05:48 +00:00
|
|
|
RewriteXml('java/core/pom.xml',
|
|
|
|
lambda document : ReplaceText(
|
|
|
|
Find(Find(document.documentElement, 'parent'), 'version'),
|
2019-02-20 19:25:39 +00:00
|
|
|
GetFullVersion()))
|
2018-12-14 23:05:48 +00:00
|
|
|
|
2019-04-24 00:06:40 +00:00
|
|
|
RewriteXml('java/lite/pom.xml',
|
|
|
|
lambda document : ReplaceText(
|
|
|
|
Find(Find(document.documentElement, 'parent'), 'version'),
|
|
|
|
GetFullVersion()))
|
|
|
|
|
2018-12-14 23:05:48 +00:00
|
|
|
RewriteXml('java/util/pom.xml',
|
|
|
|
lambda document : ReplaceText(
|
|
|
|
Find(Find(document.documentElement, 'parent'), 'version'),
|
2019-02-20 19:25:39 +00:00
|
|
|
GetFullVersion()))
|
2018-12-14 23:05:48 +00:00
|
|
|
|
2021-05-10 22:31:35 +00:00
|
|
|
RewriteXml('java/kotlin/pom.xml',
|
|
|
|
lambda document : ReplaceText(
|
|
|
|
Find(Find(document.documentElement, 'parent'), 'version'),
|
|
|
|
GetFullVersion()))
|
|
|
|
|
|
|
|
RewriteXml('java/kotlin-lite/pom.xml',
|
|
|
|
lambda document : ReplaceText(
|
|
|
|
Find(Find(document.documentElement, 'parent'), 'version'),
|
|
|
|
GetFullVersion()))
|
|
|
|
|
2018-12-14 23:05:48 +00:00
|
|
|
RewriteXml('protoc-artifacts/pom.xml',
|
|
|
|
lambda document : ReplaceText(
|
2019-02-20 19:25:39 +00:00
|
|
|
Find(document.documentElement, 'version'), GetFullVersion()))
|
2018-12-14 23:05:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
def UpdateJavaScript():
|
|
|
|
RewriteTextFile('js/package.json',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r'^ "version": ".*",$',
|
2019-02-20 19:25:39 +00:00
|
|
|
' "version": "%s",' % GetFullVersion(rc_suffix = '-rc.'),
|
2018-12-14 23:05:48 +00:00
|
|
|
line))
|
|
|
|
|
|
|
|
|
|
|
|
def UpdateMakefile():
|
|
|
|
protobuf_version_offset = 11
|
2019-09-18 20:30:03 +00:00
|
|
|
expected_major_version = 3
|
2018-12-14 23:05:48 +00:00
|
|
|
if NEW_VERSION_INFO[0] != expected_major_version:
|
2021-05-03 23:26:59 +00:00
|
|
|
print("""[ERROR] Major protobuf version has changed. Please update
|
2018-12-14 23:05:48 +00:00
|
|
|
update_version.py to readjust the protobuf_version_offset and
|
|
|
|
expected_major_version such that the PROTOBUF_VERSION in src/Makefile.am is
|
|
|
|
always increasing.
|
2021-05-03 23:26:59 +00:00
|
|
|
""")
|
2018-12-14 23:05:48 +00:00
|
|
|
exit(1)
|
|
|
|
|
2019-09-18 20:30:03 +00:00
|
|
|
protobuf_version_info = '%d:%d:0' % (
|
|
|
|
NEW_VERSION_INFO[1] + protobuf_version_offset, NEW_VERSION_INFO[2])
|
2018-12-14 23:05:48 +00:00
|
|
|
RewriteTextFile('src/Makefile.am',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r'^PROTOBUF_VERSION = .*$',
|
|
|
|
'PROTOBUF_VERSION = %s' % protobuf_version_info,
|
|
|
|
line))
|
|
|
|
|
|
|
|
|
|
|
|
def UpdateObjectiveC():
|
|
|
|
RewriteTextFile('Protobuf.podspec',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r"^ s.version = '.*'$",
|
2019-05-09 02:15:20 +00:00
|
|
|
" s.version = '%s'" % GetFullVersion(rc_suffix = '-rc'),
|
2018-12-14 23:05:48 +00:00
|
|
|
line))
|
2019-07-23 20:51:21 +00:00
|
|
|
RewriteTextFile('Protobuf-C++.podspec',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r"^ s.version = '.*'$",
|
|
|
|
" s.version = '%s'" % GetFullVersion(rc_suffix = '-rc'),
|
|
|
|
line))
|
2018-12-14 23:05:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
def UpdatePhp():
|
|
|
|
def Callback(document):
|
|
|
|
def CreateNode(tagname, indent, children):
|
|
|
|
elem = document.createElement(tagname)
|
|
|
|
indent += 1
|
|
|
|
for child in children:
|
|
|
|
elem.appendChild(document.createTextNode('\n' + (' ' * indent)))
|
|
|
|
elem.appendChild(child)
|
|
|
|
indent -= 1
|
|
|
|
elem.appendChild(document.createTextNode('\n' + (' ' * indent)))
|
|
|
|
return elem
|
|
|
|
|
|
|
|
root = document.documentElement
|
2019-02-25 23:13:59 +00:00
|
|
|
now = datetime.datetime.now()
|
|
|
|
ReplaceText(Find(root, 'date'), now.strftime('%Y-%m-%d'))
|
|
|
|
ReplaceText(Find(root, 'time'), now.strftime('%H:%M:%S'))
|
2018-12-14 23:05:48 +00:00
|
|
|
version = Find(root, 'version')
|
2019-02-20 19:25:39 +00:00
|
|
|
ReplaceText(Find(version, 'release'), GetFullVersion(rc_suffix = 'RC'))
|
2018-12-14 23:05:48 +00:00
|
|
|
ReplaceText(Find(version, 'api'), NEW_VERSION)
|
2019-02-20 19:25:39 +00:00
|
|
|
stability = Find(root, 'stability')
|
2019-02-22 19:31:48 +00:00
|
|
|
ReplaceText(Find(stability, 'release'),
|
2019-09-18 20:30:03 +00:00
|
|
|
'stable' if RC_VERSION < 0 else 'beta')
|
|
|
|
ReplaceText(Find(stability, 'api'), 'stable' if RC_VERSION < 0 else 'beta')
|
2018-12-14 23:05:48 +00:00
|
|
|
changelog = Find(root, 'changelog')
|
|
|
|
for old_version in changelog.getElementsByTagName('version'):
|
|
|
|
if Find(old_version, 'release').firstChild.nodeValue == NEW_VERSION:
|
|
|
|
print ('[WARNING] Version %s already exists in the change log.'
|
|
|
|
% NEW_VERSION)
|
|
|
|
return
|
2019-09-18 20:30:03 +00:00
|
|
|
if RC_VERSION != 0:
|
|
|
|
changelog.appendChild(document.createTextNode(' '))
|
|
|
|
release = CreateNode('release', 2, [
|
|
|
|
CreateNode('version', 3, [
|
|
|
|
FindAndClone(version, 'release'),
|
|
|
|
FindAndClone(version, 'api')
|
|
|
|
]),
|
|
|
|
CreateNode('stability', 3, [
|
|
|
|
FindAndClone(stability, 'release'),
|
|
|
|
FindAndClone(stability, 'api')
|
|
|
|
]),
|
|
|
|
FindAndClone(root, 'date'),
|
|
|
|
FindAndClone(root, 'time'),
|
|
|
|
FindAndClone(root, 'license'),
|
2020-08-21 18:12:57 +00:00
|
|
|
CreateNode('notes', 3, []),
|
2019-09-18 20:30:03 +00:00
|
|
|
])
|
|
|
|
changelog.appendChild(release)
|
|
|
|
changelog.appendChild(document.createTextNode('\n '))
|
2018-12-14 23:05:48 +00:00
|
|
|
RewriteXml('php/ext/google/protobuf/package.xml', Callback)
|
2019-02-19 23:54:45 +00:00
|
|
|
RewriteTextFile('php/ext/google/protobuf/protobuf.h',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r'PHP_PROTOBUF_VERSION ".*"$',
|
|
|
|
'PHP_PROTOBUF_VERSION "%s"' % NEW_VERSION,
|
|
|
|
line))
|
2018-12-14 23:05:48 +00:00
|
|
|
|
2019-02-20 19:25:39 +00:00
|
|
|
RewriteTextFile('php/ext/google/protobuf/protobuf.h',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r"^#define PHP_PROTOBUF_VERSION .*$",
|
|
|
|
"#define PHP_PROTOBUF_VERSION \"%s\"" % GetFullVersion(rc_suffix = 'RC'),
|
|
|
|
line))
|
2018-12-14 23:05:48 +00:00
|
|
|
|
2019-02-20 19:25:39 +00:00
|
|
|
RewriteTextFile('php/ext/google/protobuf/protobuf.h',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r"^#define PHP_PROTOBUF_VERSION .*$",
|
|
|
|
"#define PHP_PROTOBUF_VERSION \"%s\"" % GetFullVersion(rc_suffix = 'RC'),
|
|
|
|
line))
|
|
|
|
|
2018-12-14 23:05:48 +00:00
|
|
|
def UpdatePython():
|
|
|
|
RewriteTextFile('python/google/protobuf/__init__.py',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r"^__version__ = '.*'$",
|
2019-02-20 19:25:39 +00:00
|
|
|
"__version__ = '%s'" % GetFullVersion(rc_suffix = 'rc'),
|
2018-12-14 23:05:48 +00:00
|
|
|
line))
|
|
|
|
|
|
|
|
def UpdateRuby():
|
|
|
|
RewriteTextFile('ruby/google-protobuf.gemspec',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r'^ s.version = ".*"$',
|
2019-02-20 19:25:39 +00:00
|
|
|
' s.version = "%s"' % GetFullVersion(rc_suffix = '.rc.'),
|
2018-12-14 23:05:48 +00:00
|
|
|
line))
|
|
|
|
|
2021-06-25 21:07:31 +00:00
|
|
|
def UpdateBazel():
|
|
|
|
RewriteTextFile('protobuf_version.bzl',
|
|
|
|
lambda line : re.sub(
|
|
|
|
r"^PROTOBUF_VERSION = '.*'$",
|
|
|
|
"PROTOBUF_VERSION = '%s'" % GetFullVersion(),
|
|
|
|
line))
|
|
|
|
|
2018-12-14 23:05:48 +00:00
|
|
|
|
|
|
|
UpdateConfigure()
|
|
|
|
UpdateCsharp()
|
|
|
|
UpdateCpp()
|
|
|
|
UpdateJava()
|
|
|
|
UpdateJavaScript()
|
|
|
|
UpdateMakefile()
|
|
|
|
UpdateObjectiveC()
|
|
|
|
UpdatePhp()
|
|
|
|
UpdatePython()
|
|
|
|
UpdateRuby()
|
2021-06-25 21:07:31 +00:00
|
|
|
UpdateBazel()
|