https://gradle.com/ logo
#community-support
Title
# community-support
j

Jakub Chrzanowski

09/28/2022, 5:53 AM
Good morning, folks! I wonder, what’s the profit of making a task inheriting
VerificationTask
? Does that interface provide a unified setter/getter, or is there any logic within Gradle internals?
v

Vampire

09/28/2022, 9:26 AM
Well, it has a property for ignoring failures. And it will be matched if someone does
tasks.withType<VerificationTask>().configureEach { ... }
or similar, but at least in the Gradle sources I see no such configuration. I don't think there is any additional implication.
t

Thomas Broyer

09/28/2022, 12:30 PM
Fwiw, you can't use
tasks.withType<VerificationTask>()
because
VerificationTask
isn't itself a
Task
(it would probably work with the Groovy DSL and thanks to type erasure)
v

Vampire

09/28/2022, 12:41 PM
Oh, right, for whatever reason
VerificationTask
does not extend
Task
. 😞
j

Jakub Chrzanowski

09/28/2022, 12:46 PM
The reason I ask is that, for the sake of consistency, I have the
ignoreWarnings
lazy property introduced explicitly in my task.
Copy code
@get:Input
abstract val ignoreWarnings: Property<Boolean>
Now, after I started using Managed Types, I run into conflicts – setter and getter are created for
Property<Boolean>
, but methods from that interface are raw
Boolean
. It was manageable previously, but now too much magic is involved and the easiest solution is to drop
VerificationTask
completely as syntax for end-user will not change (ok, for Kotlin DSL will, but that’s acceptable).
v

Vampire

09/28/2022, 12:52 PM
I'd guess it should be fine to remove it and optionally readd it after it was propertified 🙂
j

Jakub Chrzanowski

09/28/2022, 12:53 PM
Thanks!