aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/buildgen/plugins
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanleycheung@google.com>2016-08-22 08:45:12 -0700
committerGravatar Stanley Cheung <stanleycheung@google.com>2016-08-22 08:51:47 -0700
commit557aa4e6953a90e9224b8963655f089bb29fbd95 (patch)
tree4fec3a06239b3ebf9969a64ef6670974dc057874 /tools/buildgen/plugins
parentdaf46996529a983013892344803539e9ae888f24 (diff)
php: bump version
Diffstat (limited to 'tools/buildgen/plugins')
-rwxr-xr-xtools/buildgen/plugins/expand_version.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py
index c6cc5621c9..6098cca59c 100755
--- a/tools/buildgen/plugins/expand_version.py
+++ b/tools/buildgen/plugins/expand_version.py
@@ -85,10 +85,21 @@ class Version:
return '%d.%d.%d' % (self.major, self.minor, self.patch)
def php(self):
- """Version string in PHP style"""
- """PECL does not allow tag in version string"""
- return '%d.%d.%d' % (self.major, self.minor, self.patch)
+ """Version string for PHP PECL package"""
+ s = '%d.%d.%d' % (self.major, self.minor, self.patch)
+ if self.tag:
+ if self.tag == 'dev':
+ s += 'dev'
+ elif len(self.tag) >= 3 and self.tag[0:3] == 'pre':
+ s += 'RC%d' % int(self.tag[3:])
+ else:
+ raise Exception('Don\'t know how to translate version tag "%s" to PECL version' % self.tag)
+ return s
+ def php_composer(self):
+ """Version string for PHP Composer package"""
+ return '%d.%d.%d' % (self.major, self.minor, self.patch)
+
def mako_plugin(dictionary):
"""Expand version numbers:
- for each language, ensure there's a language_version tag in