From: Seigel, J. <Jam...@av...> - 2005-06-06 15:01:01
|
I hear what you are saying. The plumbing as it exists right now isn't really set up for that, so ultimately we could get there for sure, with some work. If you poke around in the code, there is no worry about including test source if you don't want it included because only the files that have been instrumented will be pulled in to the report. The way it works is if the file is referenced in the .ser then it looks in the srcDir (or source directories post-patch) for the file quite efficiently.... uses package name and class name to pinpoint the file under the directory... I don't know what kind of impact generating a list of files that may or may not be ultimately used and then searching through the list each time to find them might have, but it is worth a look. Especially if you could re-use the same srcpath you use for instrumenting, only having to specify it once for both reports.... Anyhoo.... Your call(s)...I am just your humble coding monkey... Let me know if you guys want to see the patch this evening or not...if not I will investigate this other solution and see if I can get a patch for it in the next couple of weeks. -----Original Message----- From: Sinke, Mark (GE Healthcare) [mailto:mar...@me...]=20 Sent: Monday, June 06, 2005 8:49 AM To: Seigel, James; Jeremy Thomerson; J. Rentrop Cc: cob...@li... Subject: RE: [Cobertura-devel] Multiple Source directories In an ultimate situation, I'd like to write <path id=3D"srcpath" dir=3D"src"> <includes name=3D"*.java"/> <excludes name=3D"**/test/*"/> </path> <cobertura-report destdir=3D"${coverage.html.dir}"> <sourcepath refid=3D"srcpath"/> </cobertura-report>=20 To avoid generating reports for test classes. This would automatically get you the possibility to include multiple source directories, as in: <path id=3D"srcpath" dir=3D"src"> <includes name=3D"*.java"/> <excludes name=3D"**/test/*"/> </path> <path id=3D"src-generatedpath" dir=3D"src-generated"> <includes name=3D"*.java"/> <excludes name=3D"**/test/*"/> </path> <path id=3D"allsrcpath"> <path refid=3D"srcpath"/> <path refid=3D"src-generatedpath"/> </path> <cobertura-report destdir=3D"${coverage.html.dir}"> <sourcepath refid=3D"srcpath"/> </cobertura-report> This way we only need one path reference by the way, because the path can refer to multiple sub-paths Mark Sinke. -----Original Message----- From: Seigel, James [mailto:Jam...@av...]=20 Sent: Monday, June 06, 2005 16:30 To: Sinke, Mark (GE Healthcare); Jeremy Thomerson; J. Rentrop Cc: cob...@li... Subject: RE: [Cobertura-devel] Multiple Source directories Well I have this one implemented... > <cobertura-report destdir=3D"${coverage.html.dir}"> > <sourcepath location=3D"${src.dir}"/> > <sourcepath location=3D"${test.dir}"/> > </cobertura-report> Where you can add as many sourcepath elements as you would like. I was modelling it after how you can specify <classpath> entries for <javac>. It will also support the srcDir attribute for legacy support. I just don't know if I am happy with the names sourcepath or location...but they aren't too too bad I guess. I could post some diffs tonight if you guys are interested.... Cheers James. -----Original Message----- From: Sinke, Mark (GE Healthcare) [mailto:mar...@me...] Sent: Monday, June 06, 2005 8:27 AM To: Seigel, James; Jeremy Thomerson; J. Rentrop Cc: cob...@li... Subject: RE: [Cobertura-devel] Multiple Source directories That would be the ultimate solution; for now, I'd die for just a way to mention multiple folders... Mark.=20 |