Modified code to be able to use composer properties and git properties alternatively and together

This commit is contained in:
Mikolaj Przybysz
2016-05-12 16:38:13 +02:00
parent 329d22ec00
commit bbb1c13b79
3 changed files with 5 additions and 5 deletions

View File

@@ -30,8 +30,8 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
public static final String COMPOSER_VENDOR_NAME = "composerVendorName"; public static final String COMPOSER_VENDOR_NAME = "composerVendorName";
public static final String COMPOSER_PROJECT_NAME = "composerProjectName"; public static final String COMPOSER_PROJECT_NAME = "composerProjectName";
protected String invokerPackage = "Swagger\\Client"; protected String invokerPackage = "Swagger\\Client";
protected String composerVendorName = "swagger"; protected String composerVendorName = null;
protected String composerProjectName = "swagger-client"; protected String composerProjectName = null;
protected String packagePath = "SwaggerClient-php"; protected String packagePath = "SwaggerClient-php";
protected String artifactVersion = "1.0.0"; protected String artifactVersion = "1.0.0";
protected String srcBasePath = "lib"; protected String srcBasePath = "lib";

View File

@@ -27,11 +27,11 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi
"repositories": [ "repositories": [
{ {
"type": "git", "type": "git",
"url": "https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}{{composerVendorName}}{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{composerProjectName}}{{/gitRepoId}}.git" "url": "https://github.com/{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}.git"
} }
], ],
"require": { "require": {
"{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}{{composerVendorName}}{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{composerProjectName}}{{/gitRepoId}}": "*@dev" "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}": "*@dev"
} }
} }
``` ```

View File

@@ -1,5 +1,5 @@
{ {
"name": "{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}{{composerVendorName}}{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{composerProjectName}}{{/gitRepoId}}",{{#artifactVersion}} "name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}",{{#artifactVersion}}
"version": "{{artifactVersion}}",{{/artifactVersion}} "version": "{{artifactVersion}}",{{/artifactVersion}}
"description": "{{description}}", "description": "{{description}}",
"keywords": [ "keywords": [