From 3dab4628c6d72e50d0945be127e558c35c22f20c Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Wed, 23 Mar 2016 13:04:53 -0700 Subject: [PATCH] php: remove hardcoded version in templates --- templates/composer.json.template | 27 ++++++++++++++++++++++++ templates/package.xml.template | 8 +++---- tools/buildgen/plugins/expand_version.py | 5 +++++ 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 templates/composer.json.template diff --git a/templates/composer.json.template b/templates/composer.json.template new file mode 100644 index 00000000000..275b4655ced --- /dev/null +++ b/templates/composer.json.template @@ -0,0 +1,27 @@ +%YAML 1.2 +--- | + { + "name": "grpc/grpc", + "type": "library", + "description": "gRPC library for PHP", + "version": "${settings.php_version.php()}", + "keywords": ["rpc"], + "homepage": "http://grpc.io", + "license": "BSD-3-Clause", + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/stanley-cheung/Protobuf-PHP" + } + ], + "require": { + "php": ">=5.5.0", + "datto/protobuf-php": "dev-master", + "google/auth": "v0.7" + }, + "autoload": { + "psr-4": { + "Grpc\\": "src/php/lib/Grpc/" + } + } + } diff --git a/templates/package.xml.template b/templates/package.xml.template index 8f757401e4c..2f498c02f45 100644 --- a/templates/package.xml.template +++ b/templates/package.xml.template @@ -15,8 +15,8 @@ 2016-03-01 - 0.14.0 - 0.14.0 + ${settings.php_version.php()} + ${settings.php_version.php()} beta @@ -157,8 +157,8 @@ - 0.14.0 - 0.14.0 + ${settings.php_version.php()} + ${settings.php_version.php()} beta diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py index b55e1b15ff8..dd77f7af125 100755 --- a/tools/buildgen/plugins/expand_version.py +++ b/tools/buildgen/plugins/expand_version.py @@ -84,6 +84,11 @@ class Version: else: 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) + def mako_plugin(dictionary): """Expand version numbers: - for each language, ensure there's a language_version tag in