Slackbot
06/01/2023, 3:17 PMClayton Walker
06/01/2023, 3:17 PMClayton Walker
06/01/2023, 3:18 PMClayton Walker
06/01/2023, 3:20 PMtasks.jacocoTestReport {
classDirectories.setFrom(
classDirectories.files.map {
fileTree(it) {
exclude(codeCoverageExclusions)
}
}
)
}
but I’m not 100% sure if that’s the best way.Clayton Walker
06/01/2023, 3:25 PMtasks.jacocoTestReport {
classDirectories.setFrom(
classDirectories.asFileTree.matching {
exclude(codeCoverageExclusions)
}
)
}
?Vampire
06/01/2023, 3:45 PMafterEvaluate
and not depend on the timing problems it adds, is to use a "configure task" like this:
val applyJacocoTestReportExcludes by tasks.registering {
doLast {
tasks.withType<JacocoReport> {
classDirectories.setFrom(classDirectories.asFileTree.matching {
exclude(
...
)
}.files)
}
}
}
tasks.jacocoTestReport {
dependsOn(applyJacocoTestReportExcludes)
}
jacocoIntegTestReport {
dependsOn(applyJacocoTestReportExcludes)
}
But this will only work if you do not need configuration cache compatibility, because configuring tasks from the execution phase of other tasks is not supported with it.Vampire
06/01/2023, 3:48 PMVampire
06/01/2023, 3:49 PMGenerated
annotation that has CLASS
retention and not use that hack-around at all.Clayton Walker
06/01/2023, 4:15 PMVampire
06/01/2023, 4:51 PM