aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanley.cheung@gmail.com>2016-08-23 08:37:07 -0700
committerGravatar GitHub <noreply@github.com>2016-08-23 08:37:07 -0700
commitd7ff4ff40071d2b486a052183e3e9f9382afb745 (patch)
treea48299c3169d789ab4026cb100c3823c60200db5 /tools
parent67920ca2e6050befafca1e99a07b6c8564fef021 (diff)
parent8749c96595f4f6a9a000f3e30a54ada0d1a9b1ae (diff)
Merge pull request #7817 from stanley-cheung/php-update-composer-v1_0
PHP: bump version
Diffstat (limited to 'tools')
-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