Filter JaCoCo coverage reports with Gradle

Thanks to, Yannick Welsch: After searching Google, reading the Gradle docs and going through older StackOverflow posts, I found this answer on the Official gradle forums! jacocoTestReport { afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { fileTree(dir: it, exclude: ‘com/blah/**’) })) } } Source: For older gradle versions < 5.x may need to use classDirectories = files(classDirectories.files.collect { … Read more