I can't configure all verification tasks using withType function in the following way:
tasks.withType<VerificationTask> {
ignoreFailures = false
}
The VerificationTask is an interface that does not extend Task.
withType is declared as following:
fun <reified S : Any> DomainObjectCollection<in S>.withType(crossinline configuration: S.() -> Unit)
TaskContainer is a DomainObjectCollection<Task>. Therefore only Task and its subtypes can be used as S.
kotlin-dsl embedded in Gradle 4.2
I believe in S projection is not appropriate here, because the function doesn't put anything _into_ the collection.
Another unfortunate thing is, I think in Groovy it just kind of works because Groovy throws out generic information.
tasks.withType(VerificationTask) {
ignoreFailures = false
}
I haven't tried that, but I think it actually works.
Other types that also impacts are:
I agree. The constraint is inherited from the Gradle API so we first need to change it there:
Closing in favor of upstream https://github.com/gradle/gradle/issues/4050
Most helpful comment
I agree. The constraint is inherited from the Gradle API so we first need to change it there: