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

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

Open
wing328 opened this issue Apr 19, 2017 · 8 comments

Comments

@wing328
Copy link
Contributor

wing328 commented Apr 19, 2017

Description

As discussed in #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
Copy link
Contributor

auchri commented Apr 19, 2017

There should be three different variables:

  • {{androidGradleVersion}} for the version of gradle (used in classpath 'com.android.tools.build:gradle:2.3.+')
  • {{androidSdkVersion}} for the compile and target sdk varion (used in compileSdkVersion 25 and targetSdkVersion 25)
  • {{androidBuildToolsVersion}} for the version of the build tools (used in buildToolsVersion '25.0.2')

@wing328
Copy link
Contributor Author

wing328 commented Apr 19, 2017

@auchri thanks for the elaboration.

@cbornet
Copy link
Contributor

cbornet commented Apr 19, 2017

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

@wing328
Copy link
Contributor Author

wing328 commented Apr 22, 2017

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

@myashchenko
Copy link
Contributor

myashchenko commented Jul 25, 2017

@wing328 added #6160 PR. Please, review it

@wing328
Copy link
Contributor Author

wing328 commented Jul 27, 2017

Closed via #6160

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

@aleksandr1592
Copy link

aleksandr1592 commented Dec 7, 2017

@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
Copy link
Contributor Author

wing328 commented Dec 11, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants