Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Generator shell] improve gen_name parsing #2565

Merged

Conversation

Projects
None yet
3 participants
@karismann
Copy link
Contributor

commented Apr 1, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.

Description of the PR

  • fix #1795 : test path/package name for generated test in case of composed generated name (i.e java-newframework)
  • use the camelized generated name everywhere in the generation script (remove blank and underscore)
  • add an error if no generator type are in parameter (i.e. ./new.sh -n 'java-greatframework' -t)

here is some test done with the new version of the script :

$ ./new.sh -n 'java-greatframework' -s -t
Creating modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaGreatframeworkServerCodegen.java
Creating modules/openapi-generator/src/main/resources/java-greatframework-server/README.mustache
Creating modules/openapi-generator/src/main/resources/java-greatframework-server/model.mustache
Creating modules/openapi-generator/src/main/resources/java-greatframework-server/api.mustache
Creating bin/windows/java-greatframework-server-petstore.bat
Creating bin/java-greatframework-server-petstore.sh
Creating modules/openapi-generator/src/test/java/org/openapitools/codegen/java/greatframework/JavaGreatframeworkServerCodegenTest.java
Creating modules/openapi-generator/src/test/java/org/openapitools/codegen/java/greatframework/JavaGreatframeworkServerCodegenModelTest.java
Creating modules/openapi-generator/src/test/java/org/openapitools/codegen/java/greatframework/JavaGreatframeworkServerCodegenOptionsTest.java
Creating modules/openapi-generator/src/test/java/org/openapitools/codegen/options/JavaGreatframeworkServerCodegenOptionsProvider.java
Finished.
$ ./new.sh -n 'java greatframework3' -t -c
Creating modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaGreatframework3ClientCodegen.java
Creating modules/openapi-generator/src/main/resources/java-greatframework3-client/README.mustache
Creating modules/openapi-generator/src/main/resources/java-greatframework3-client/model.mustache
Creating modules/openapi-generator/src/main/resources/java-greatframework3-client/api.mustache
Creating bin/windows/java-greatframework3-client-petstore.bat
Creating bin/java-greatframework3-client-petstore.sh
Creating modules/openapi-generator/src/test/java/org/openapitools/codegen/java/greatframework3/JavaGreatframework3ClientCodegenTest.java
Creating modules/openapi-generator/src/test/java/org/openapitools/codegen/java/greatframework3/JavaGreatframework3ClientCodegenModelTest.java
Creating modules/openapi-generator/src/test/java/org/openapitools/codegen/java/greatframework3/JavaGreatframework3ClientCodegenOptionsTest.java
Creating modules/openapi-generator/src/test/java/org/openapitools/codegen/options/JavaGreatframework3ClientCodegenOptionsProvider.java
Finished.
$ ./new.sh -n 'java-greatframework' -t
[error] You may set a generator type
@wing328

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

@karismann thanks for the enhancement.

cc @jimschubert who created the script.

@wing328 wing328 added this to the 4.0.0 milestone Apr 2, 2019

@jimschubert jimschubert self-assigned this Apr 2, 2019

@jimschubert

This comment has been minimized.

Copy link
Member

commented Apr 6, 2019

Thanks for another great contribution, Vincent!

@jimschubert jimschubert merged commit 783f16f into OpenAPITools:master Apr 6, 2019

4 checks passed

Shippable Run 7086 status is SUCCESS.
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@karismann karismann deleted the karismann:New-Generator-shell-improve branch Apr 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.