Cobertura plug-in coverageExcludes


(jburbridge) #1

Has anyone had any success in excluding certain packages from Cobertura’s code coverage report? The plug-in documentation states there’s a convention property as follows:

coverageExcludes (type: List) – List of regular expressions to specify which class files to exclude from coverage report

However, neither one of these seems to work:

cobertura {
    coverageExcludes = [ '*.\mypackage\..*' ];
}

Or following the ant-style pattern:

cobertura {
    coverageExcludes = [ '**/mypackage/*' ];
}

Has anyone managed to get this to successfully exclude classes from the coverage report / count?

Cheers, JB


(jburbridge) #2

Looks like I managed to break the syntax highlighter with a bit of regex. Interesting.

Make that first bit:

cobertura {

coverageExcludes = [ ‘.\mypackage…’ ]; }