I'm having trouble getting the jacoco / junit ant target to exclude classes from scope. I can make it exclude packages, although with something like this:
<jacoco:coverage destfile="${coverage.reports.dir.xml}/output.jacoco" excludes="foo.*:bar.fiz.*:my.long.package.name.*">
This does not exclude my test classes because the test classes are in the same package as the classes they are testing. I'm tired of excluding test classes with regex, but that won't work.
<jacoco:coverage destfile="${coverage.reports.dir.xml}/output.jacoco" excludes="foo.*:bar.fiz.*:**/Test.*:**/Tests.*">
I also tried just to include the classes that I want in the report task, but since our test classes are in the same packages that do not work. Our assembly places all classes in the same directory, for example buildRoot / classes / ProjectName. Therefore, buildRoot / classes / ProjectName / foo will contain compiled classes for tests and non-test classes.
Any suggestions on how to get jacoco to exclude all tests in this setting?
thank.
jacoco
adhamh Jan 18 '13 at 17:58 2013-01-18 17:58
source share