php: remove hardcoded version in templates

pull/5931/head
Stanley Cheung 9 years ago
parent 9a1fa344e7
commit 3dab4628c6
  1. 27
      templates/composer.json.template
  2. 8
      templates/package.xml.template
  3. 5
      tools/buildgen/plugins/expand_version.py

@ -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/"
}
}
}

@ -15,8 +15,8 @@
<date>2016-03-01</date>
<time>16:06:07</time>
<version>
<release>0.14.0</release>
<api>0.14.0</api>
<release>${settings.php_version.php()}</release>
<api>${settings.php_version.php()}</api>
</version>
<stability>
<release>beta</release>
@ -157,8 +157,8 @@
</release>
<release>
<version>
<release>0.14.0</release>
<api>0.14.0</api>
<release>${settings.php_version.php()}</release>
<api>${settings.php_version.php()}</api>
</version>
<stability>
<release>beta</release>

@ -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

Loading…
Cancel
Save