ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xxx Yyy <ybobble-antmailingl...@yahoo.com>
Subject Re: proper use of filesets...
Date Wed, 23 Jun 2004 12:26:10 GMT
Although they look similar, they are very different in the files that
they include.  When you omit the <include/> or <exclude/> from a
fileset, it gets a default include/exclude list.

For example,
   <fileset dir="dir1"/>
could contain a file such as "dir1/test.txt".

When you specify <include/> that overrides the default list.
This fileset
   <fileset dir=".">
     <include name="dir1"/>
   </fileset>

cannot contain "dir1/test.txt".  It can contain, at most, "dir1".


This makes a difference in your example because delete will not delete
directories that are not empty.  The first fileset will delete the
directory "dir1" (assuming that it doesn't contain files in the exclude
list).  The second fileset will not delete "dir1" if it contains any
file.



--- EJ Ciramella <eciramella@upromise.com> wrote:
> What's the best way to use filesets (in tasks that
> support them)?
> 
> Delete, for example, you can use filesets two ways:
> 
>   <delete includeEmptyDirs="true">
>     <fileset dir="dir1"/>
>     <fileset dir="dir2"/>
>   </delete>
> 
> or 
> 
>   <delete includeEmptyDirs="true">
>     <fileset dir="${parent.dir}">
>      <include name="dir1"/>
>      <include name="dir2"/>
>     </fileset>
>   </delete>
> 
> I prefer the second example, but is there any
> benefit of one over the other?
> 
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message