swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.99k stars 6.03k forks source link

[Android] use additional properties to manage Android version numbers more easily #5422

Open wing328 opened 7 years ago

wing328 commented 7 years ago
Description

As discussed in https://github.com/swagger-api/swagger-codegen/pull/5250, we want to leverage additional properties to more easily manage Android version numbers in the gradle files generated as part of the Android API client.

We want to replace android version number with {{androidVersionNumber}} tag in the mustache templates so that users can set it directly via --additional-properties when generating the API clients.

Swagger-codegen version

Latest master

Suggest a Fix

If anyone has questions/suggestions or wants to work on this enhancement, please reply to let us know. Thank you.

auchri commented 7 years ago

There should be three different variables:

wing328 commented 7 years ago

@auchri thanks for the elaboration.

cbornet commented 7 years ago

Do we really need to add so much options just to change a version in a gradle file ?

wing328 commented 7 years ago

@cbornet we can start with just --additional-properties to make the versions more easily customizable.

myashchenko commented 7 years ago

@wing328 added #6160 PR. Please, review it

wing328 commented 7 years ago

Closed via #6160

@auchri please pull the latest master to give it a try.

aleksandr1592 commented 6 years ago

@wing328 Hello. I'm encountering problem when I want to set to set such properties while building retrofit2 library. Retrofit2 library missing in "android languge" package so I have to build it from java package. Also at least one more property requried - gradleDistributionUrl or gradleDistributionVersion, because gradle android pluging is tightly coupled to gradle version ( see chart) Do you need pull request to add same properties to "java language" package ?

wing328 commented 6 years ago

@aleksandr1592 yes, we would welcome contribution (PR) to add those to the Java (retrofit2) client generator.