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

False usage of gradle cache on new code generator version #290

Open
NilsDammenhayn opened this issue Jan 8, 2022 · 1 comment
Open

False usage of gradle cache on new code generator version #290

NilsDammenhayn opened this issue Jan 8, 2022 · 1 comment
Labels

Comments

@NilsDammenhayn
Copy link

NilsDammenhayn commented Jan 8, 2022

I'm running a service with two gradle modules - service and model - where the model only contains the code generation to leverage the usage of gradle cache in builds. If the version of the used generator changes the models are not freshly generated but taken from the cache, although the task has no way of knowing if the new sources will be the same as the old ones.

This can lead to breaking later builds although the initial build that updated the generator looked fine.

A workaround is to define this version as an additional property but imho this should not be necessary as the plugin can never assume anything about the sources generated by a new version. So this version should always be part of the tasks inputs to influence the gradle cache's key.

To Reproduce:
Build a module with any code generator -> change version of said generator -> building again will take the results from the gradle cache instead of creating new sources.

Expected behavior:
Sources are freshly generated if the generator version changes.

Environment

Plugin version: 2.19.1
Swagger Codegen version: io.swagger.codegen.v3:swagger-codegen-cli:3.0.30 / io.swagger.codegen.v3:swagger-codegen-cli:3.0.31
Gradle version: 7.3.3
Java version: 11.0.13
OS: macOS Big Sur 11.6.2

@reaver585
Copy link

Bumping this issue since I have run into the same problem recently.

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

No branches or pull requests

2 participants