Description
A customer is trying to gather coverage info across multiple "projects" with ant. All projects are writing into the same clover database and then using an ant macro we try to generate reports on a per project basis:
<macrodef name="clover2xml"> <attribute name="projectName" /> <sequential> <clover-report initstring="${initstring}"> <current outfile="@{projectName}_clover.xml"> <fileset dir="../@{projectName}/src" includes="**/*.java"/> </current> </clover-report> <echo message="@{projectName}" /> </sequential> </macrodef>
The problem is that the fileset is not working correctly.
Chat with Nick:
it seems we have a problem with fuzzyMatch:
private boolean fuzzyMatch(FileInfo fileInfo) { final Set<String> paths = fileNamesToPaths.get(fileInfo.getName()); if (paths != null) { final String packagePath = fileInfo.getPackagePath(); for (String path : paths) { if (path.endsWith(packagePath)) { return true; } } } return false; }we are doing our best, to detect where a package name ends/starts in relation to a directory
the accept logic is:if (exactMatch(fileInfo) || fuzzyMatch(fileInfo)) {
we may need another option to not try and fuzzyMatch... or, we remove it altogether
here are some fuzzy matching fails:
[clover-report] TRYING TO FUZZY MATCH = /Users/niick/Downloads/clv-5397/CLV-5397_2/src/bar1/Test1.java
[clover-report] FUZZY MATCHED PACKAGE path = /Users/niick/Downloads/clv-5397/CLV-5397_1/src/foo/Test1.javaand: [clover-report] TRYING TO FUZZY MATCH = /Users/niick/Downloads/clv-5397/CLV-5397_2/src/bar2/Test2.java
[clover-report] FUZZY MATCHED PACKAGE path = /Users/niick/Downloads/clv-5397/CLV-5397_1/src/foo/Test2.java