Below is the code snippet I'm using in gradle 7.1.1 and Jacoco version 0.8.4 and getting a build error
Could not find method setFrom() for arguments [file collection] on main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
jacocoTestReport {
group = "Reporting"
reports {
xml.enabled false
csv.enabled false
html.enabled true
html.destination "${buildDir}/reports/jacoco"
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: [
''
]
)
}))
}
}