A major drawback of <classfileset> is that nested <rootfileset>s are limited to have base dir same as base dir of a containing <classfilset>. The suggested simple patch solves this problem. DependSet is modified to hold a collection of additionalBaseDirs which is populated from all the <rootfilesets>. This collection is then used to add classpaths to DependencyAnalyzer.
Created attachment 17125 [details] ClassfileSet diff
Created attachment 17126 [details] DependScanner diff
This looks reasonable. It would look more reasonable, however, with a testcase (i.e. I would commit it if it had one). ;)
svn revision 808310
I downloaded the latest version of ANT with the fix (I checked in the sources) but it still does not work if I use several directories via rootfileset. <classfileset id="reqdClasses" dir="_temp_ptp_2" rootclass="main.MainClass"> <rootfileset dir="_temp_ptp_1" /> <rootfileset dir="_temp_ptp_2" /> </classfileset> Do I use the syntax incorrectly? Sadly there is no working example in the testcases.
It seems classes in additional rootfileset(s) are simply added to the classfileset. I hoped the rootfileset(s) would extend the 'classpath' where classfileset searches for dependent classes and adds classes only if they are dependent to the rootclass. This feature makes a lot of sense.