Fix Gradle Plugin ValidateTask not working under Gradle 7.0#9453
Fix Gradle Plugin ValidateTask not working under Gradle 7.0#9453wing328 merged 3 commits intoOpenAPITools:masterfrom
Conversation
3e070ad to
a1e9db6
Compare
|
No idea why one of the CI jobs is not passing. And I am not sure this even relates to the changes in this PR. |
a1e9db6 to
59fbd39
Compare
|
Doesnt look like its a realted test failure, just wait it out and update your pr in a few days. it happens from time to time. |
ad062e8 to
e9bc663
Compare
|
@rm3l thanks for the PR. Is it correct to say that this change is also backward-compatible with Gradle 5.x and 6.x? |
Yes, the changes here should be backward-compatible with the older versions of Gradle. In our project at work, I personally tested the changes here against both Gradle 6.9 and Gradle 7.0 To prevent potential regressions in the future, I actually updated the ValidateTaskDslTest test class. The DataProvider added currently runs the same test suite against different versions of Gradle:
But I will also include Gradle 6.x, so it can be tested as well. |
1097d48 to
eca97f2
Compare
eca97f2 to
86c1a7a
Compare
|
cc @OpenAPITools/generator-core-team |
86c1a7a to
c035c6a
Compare
|
If no further feedback, I'll merge this PR tomorrow (Wed). |
This is applicable to the following properties: - inputSpec - recommend Otherwise, Gradle 7.0 now returns an error when attempting to configure this task. See https://docs.gradle.org/7.0/userguide/validation_problems.html#mutable_type_with_setter
…slTest Test against the latests Gradle 5.x and 6.x versions
c035c6a to
54543c7
Compare
This fixes #9328, which prevents from using the OpenAPI Generator Gradle Plugin with the latest Gradle 7.0.
As of Gradle 7.0, an error is returned at configuration time if a plugin task declares a property of "mutable" type with a setter.
See https://docs.gradle.org/7.0/userguide/validation_problems.html#mutable_type_with_setter for further details.
This PR fixes this issue by declaring such properties as Kotlin
valmembers instead, so they do not have setters.To validate that the fix works, this PR also adds the capability to run the same set of tests in
ValidateTaskDslTestusing different instances ofGradleRunner, configured with different versions of Gradle.@agilob and @jimschubert I'm mentioning the two of you since you reviewed a similar PR (#9059 ) about
GenerateTask.cc @ilya40umov @wing328
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master,5.1.x,6.0.x