Use setFrom for the file collections of JaCoCo tasks

MSAL

Gradle 6.0 removed the setters of classDirectories, executionData, sourceDirectories, additionalClassDirs and additionalSourceDirs from JacocoReportBase. Assigning one fails with Cannot set the value of read-only property on Gradle 6.9 and 7.6, and with Val cannot be reassigned in a Kotlin script. Later Gradle versions accept the assignment again, but setFrom works on all of them. This recipe acts only on assignments inside JaCoCo report and coverage verification task configuration. See the Gradle upgrade guide for more information.

org.openrewrite.gradle.migrate.jacoco.UseSetFromForJacocoFileCollections
mod run . --recipe=org.openrewrite.gradle.migrate.jacoco.UseSetFromForJacocoFileCollections

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.