Hi,

the Gradle integration is done by the Gradle project itself. I recommend also asking at their forum:

 * http://gradle.org/docs/current/userguide/jacoco_plugin.html
 * http://discuss.gradle.org/c/bugs

Regards,
-marc


On 21.04.15 00:30, [email protected] wrote:
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,



--
You received this message because you are subscribed to the Google Groups "JaCoCo 
and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/553628BE.4020507%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to