sgo...@gmail.com
unread,Apr 20, 2015, 6:30:53 PM4/20/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jac...@googlegroups.com
Hello,
I am using jacoco with gradle and I am able to generate reports, however when I try to use filters (Includes, Excludes) its not working as expected. Here's how my generate report task looks like:
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/*.exec")
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
html.enabled true
html.destination "${buildDir}/reports/jacoco"
csv.enabled false
}
classDirectories = fileTree(
dir: "/mnt/home/user1/src/repo/myclasses",
includes: ['**/com/blahblah/**/*'],
excludes: ['**/org/apache/**/*',
'**/com/google/**/*',
'HelloWorld*class',
'UT_*.class',
]
)
}
Iteration #1: First time I run this "codeCoverageReport" task without any filters (meaning clasDirectories override comented out). Jacoco tells me its writing bundle with 7000 classes.
[ant:jacocoReport] Writing bundle 'source' with 7000 classes
Iteration #2: This time I copied the class files to "myclasses" directory and my "classDirectories" override looks like this (no includes and excludes)
classDirectories = fileTree(
dir: "/mnt/home/user1/src/repo/myclasses",
)
Jacoco tells me its writing bundle with 14000 classes.
[ant:jacocoReport] Writing bundle 'source' with 14000 classes
Iteration #3: I apply filters with excludes (trying to exclude all class files to see what I get)
classDirectories = fileTree(
dir: "/mnt/home/user1/src/repo/myclasses",
excludes: ['*.class',
]
)
jacoco reports writing bundle with 7000 classes.
Bottom line I want filters to work, if I don't override classDirectories nothing seems to work, with overriding it kinda works but seems to be picking up the "default" classes as well.
Can someone help me here please.
Thanks,