Bug Report Checklist
Description
ValidateTask stops working if gradle version is upgraded to 7.0.
The following task definition works under 6.8.3, but fails under 7.0:
val validateOpenApi by registering(ValidateTask::class) {
group = "verification"
description = "Validate openapi.yaml"
recommend.set(true)
input = "$rootDir/openapi.yaml"
}
val check by registering {
dependsOn(validateOpenApi)
}
Here is the output:
* What went wrong:
Some problems were found with the configuration of task ':validateOpenApi' (type 'ValidateTask').
- Type 'ValidateTask' property 'inputSpec' of mutable type 'org.gradle.api.provider.Property' is writable.
Reason: Properties of type 'org.gradle.api.provider.Property' are already mutable.
Possible solution: Remove the 'setInputSpec' method.
Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#mutable_type_with_setter for more details about this problem.
- Type 'ValidateTask' property 'recommend' of mutable type 'org.gradle.api.provider.Property' is writable.
Reason: Properties of type 'org.gradle.api.provider.Property' are already mutable.
Possible solution: Remove the 'setRecommend' method.
Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#mutable_type_with_setter for more details about this problem.
openapi-generator version
id("org.openapi.generator") version "5.1.0" apply false
Suggest a fix
Apparently the following properties of ValidateTask should not be declared as var as they are already mutable properties anyway:
@get:InputFile
@PathSensitive(PathSensitivity.RELATIVE)
var inputSpec = project.objects.property<String>()
@Optional
@Input
var recommend = project.objects.property<Boolean?>()
Bug Report Checklist
Description
ValidateTask stops working if gradle version is upgraded to 7.0.
The following task definition works under 6.8.3, but fails under 7.0:
Here is the output:
openapi-generator version
id("org.openapi.generator") version "5.1.0" apply falseSuggest a fix
Apparently the following properties of ValidateTask should not be declared as
varas they are already mutable properties anyway: