diff options
author | Stanley Cheung <stanley.cheung@gmail.com> | 2016-08-23 08:37:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 08:37:16 -0700 |
commit | 56d7044ed808e08af8b7a812a140bd751622f15c (patch) | |
tree | b123e92d7e67d64ba518950a176b1e5d8c21fb15 /tools | |
parent | 0e43d67602096a5c4aeab4632579bc56cf692553 (diff) | |
parent | 557aa4e6953a90e9224b8963655f089bb29fbd95 (diff) |
Merge pull request #7819 from stanley-cheung/php-update-composer
PHP: bump version (master)
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/buildgen/plugins/expand_version.py | 17 |
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 |