Martin Aliger wrote:
Interesting. I think there is an opportunity for optimizing this, to eliminate the asis by changing the synchronization point. For example, if the contents of the foo1 fileset were not computed until actually needed, then you could do away with the asis and apply the exclude.Hi Gary,
as I implemented it, it converts scanned files from first fileset to full path asis includes. So
<fileset id="foo1" basedir="X:\nant\t1"> <include name="world.peace" /> <include name="world.war"/> </fileset> <fileset id="foo2" basedir="X:\nant\t1"> <includesfileset refid="foo1"/> <exclude name="world.war"/> <include name="reefer.saddness" /> </fileset> becomes <fileset id="foo2" basedir="X:\nant\t1"> <include asis="true" name="X:\nant\t1\world.peace"/> <include asis="true" name="X:\nant\t1\world.war"/> <exclude name="world.war"/> <include name="reefer.saddness" /> </fileset>
To your question with excludes: - all excludes in foo1 are respected. - no exclude in foo2 take effect on included files. Thats something which is already in place. Excludes do _not_ affect asis includes. It sounds a little strange to me, but I'd rather not change something what is in place for several years.
Is this behaviour right? Maybe yes. I think about <includesfileset> like fileset merging operation - so you merge existing fileset with some include/exclude mask. But I see, there is no way how to filter out existing fileset to another one... So maybe its not right way? Ideas?
Note: reason why I used asis is to prevent double-scan. asis includes are
not scanned anymore, and all included files via includesfileset was scanned
once already.
Part of the problem is that asis seems to violate the principle of one method/class/object/parameter should do one thing. It's doing three things: suppressing the existence check, suppressing the application of excludes, and suppressing the pattern matching (in case you were on a file system silly enough to allow asterisks in the file name). I doubt the last is necessary; it could just be poor wording in the documentation. I don't know if there's a justification for suppressing the excludes.
What happens if you remove the implicit asis that you generate, and instead insert explicit asis attributes into the foo1 fileset? (Regardless of what the decision is, the test cases need to include all combinations of asis, include, exclude, fromdir, relative basedir, absolute basedir, and omitted basedir.)
Gary
------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ nant-developers mailing list nant-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-developers