I'm trying to exclude from jacoco coverage an entire package, but it's not working.
I've followed the instructions reported in this answer Filter JaCoCo coverage reports with Gradle , but it seems that it is not working for me.
This is the code:
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/jacocoHtml"
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['it.unibo.distributedBLS.main/**'])
})
}
}
I've also tried variations like excludes +=, writing
'**/it.unibo.distributedBLS.main/**'
and also by adding
test {
jacoco {
excludes += ['it.unibo.distributedBLS.main/**',
}
}
but still not working.
One thing not clear to me it's what "dir: it" stands for: what should I put there? Could it be that the error?