aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/buildgen
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-08-24 18:22:24 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-08-24 18:22:24 -0700
commit78cc066db2a2c8d65f63826f9f76f81c16d63b03 (patch)
tree12b5a169bd6b967ebcee2226d5b93f69bcb03609 /tools/buildgen
parent4dd1891665024d98b6655326f0c6277793b9b055 (diff)
parent19ea0cffd7ba3df686ed05671f9ed35b8e9fa830 (diff)
Merge remote-tracking branch 'upstream/master' into cares_buildin
Diffstat (limited to 'tools/buildgen')
-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