version.py: Also update the VERSION file

When updating the version, the VERSION file also needs to be updated.

The documentation implies that the version.py file does that, but it
doesn't.

Update the version.py file tool to do it.

Change-Id: I8671688e819608659685b79a553c592604093890
This commit is contained in:
David Pursehouse 2015-01-22 16:42:36 +09:00
parent 5b42593bbd
commit a022f3ea15

View File

@ -19,6 +19,12 @@ import os.path
import re
import sys
version_text = """# Maven style API version (e.g. '2.x-SNAPSHOT').
# Used by :api_install and :api_deploy targets
# when talking to the destination repository.
#
GERRIT_VERSION = '%s'
"""
parser = OptionParser()
opts, args = parser.parse_args()
@ -49,3 +55,9 @@ for project in ['gerrit-extension-api', 'gerrit-plugin-api',
outfile.write(outxml)
except IOError as err:
print('error updating %s: %s' % (pom, err), file=sys.stderr)
try:
with open('VERSION', "w") as version_file:
version_file.write(version_text % new_version)
except IOError as err:
print('error updating VERSION: %s' % err, file=sys.stderr)