From: SourceForge.net <no...@so...> - 2010-01-14 05:03:55
|
Feature Requests item #2790549, was opened at 2009-05-12 11:56 Message generated for change (Comment added) made by squig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720018&aid=2790549&group_id=130558 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: aLeXx (buhhunyx) Assigned to: Nobody/Anonymous (nobody) Summary: ant: allow to specify multiple directories with sources Initial Comment: I have project directory with set of subproject. Following call doesn't include sources to report: <dirset id="src.dirset" dir="${prjDir}" > <include name="**/src" /> </dirset> <property name="src.dir" refid="src.dirset"/> <cobertura-report format="html" datafile="${cobertura.ser}" destdir="${testResultsDir}/cobertura-report" srcdir="${src.dir}"/> Can be possible to specify source directories using nested dirset instead of filesets: <cobertura-report format="html" datafile="${cobertura.ser}" destdir="${testResultsDir}/cobertura-report"> <dirset dir="${prjDir}" > <include name="**/src" /> </dirset> </cobertura-report> ---------------------------------------------------------------------- Comment By: Steffen Pingel (squig) Date: 2010-01-14 06:03 Message: The dirset support has a bug: Instead of passing absolute paths to the reporting application it ignores the base directory on the dirset and uses a relative path. That means it will only work as expected if your build is running from the same directory that is set as the base directory on the dirset. Here is a crude but working fix: Index: cobertura/src/net/sourceforge/cobertura/ant/CommonMatchingTask.java =================================================================== --- cobertura/src/net/sourceforge/cobertura/ant/CommonMatchingTask.java (revision 689) +++ cobertura/src/net/sourceforge/cobertura/ant/CommonMatchingTask.java (working copy) @@ -174,7 +174,13 @@ */ throw new BuildException("Dirsets have to come before filesets"); } - createArgumentsForFilenames( builder, getDirectoryScanner(fileSet).getIncludedDirectories()); + DirectoryScanner scanner = getDirectoryScanner(fileSet); + String[] filenames = scanner.getIncludedDirectories(); + for (int i = 0; i < filenames.length; i++) + { + filenames[i] = baseDir(fileSet) + "/" + filenames[i]; + } + createArgumentsForFilenames( builder, filenames); } } } ---------------------------------------------------------------------- Comment By: aLeXx (buhhunyx) Date: 2009-05-13 10:38 Message: I think that problem is with relative path. Possible solution <path id="src.dirset"> <dirset dir="${srcDir}/plugins" > <include name="**/src" /> </dirset> </path> But cobertura-report doesn't support the nested "path" element. ---------------------------------------------------------------------- Comment By: aLeXx (buhhunyx) Date: 2009-05-13 09:05 Message: Actualy latest version used. I tried different combination but without results. >From example above: <dirset id="src.dirset" dir="${prjDir}" > <include name="**/src" /> </dirset> <property name="src.dir" refid="src.dirset"/> <echo>${src.dir}</echo> [echo] org.eclipse.swordfish.registry.tooling\src;org.eclipse.swordfish.tooling.target\src;org.eclipse.swordfish.tooling.ui\src Can you provide me valid sample with dirset? ---------------------------------------------------------------------- Comment By: John Lewis (lewijw) Date: 2009-05-12 15:53 Message: What version of Cobertura are you using? Dirset support was added to 1.9.1. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720018&aid=2790549&group_id=130558 |