ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Atherton <br...@callenish.com>
Subject RE: Maybe <present> should work with another file set.
Date Sat, 08 Jun 2002 00:17:24 GMT
At 01:05 PM 6/7/2002 -0700, Alexey Solofnenko wrote:

>I am preparing a image directory by copying files from several folders.
>After that I want to delete obsolete files (instead of deleting the whole
>directory at the beginning). The code is something like:
>
><copy todir="${image}">
>   <fileset .../>
></copy>
><delete>
>   <fileset dir="${image}">
>     <present targetdir="${src_dir} present="srconly"/>
>   </fileset>
></delete>
>
>However source fileset can be quite complex. Do you think this feature
>should be added into ANT?

Ok, I'm more clear on why you want this. Reusing filesets when detecting 
obsolete files does make sense.

I think that there is another way to get that reuse, though. You could have 
something like this:

<project basedir="." target="create.new">
   <selector id="complicated-selection">
     ...
   </selector>

   <target name="create.new">
     <copy todir="${image}">
       <fileset dir="${src_dir}">
         <selector refid="complicated-selection"/>
       </fileset>
     </copy>
   </target>

   <target name="remove.obsolete">
     <delete>
       <fileset dir="${image}">
         <and>
           <selector refid="complicated-selection"/>
           <present targetdir="${src_dir}" present="srconly"/>
         </and>
       </fileset>
     </delete>
   </target>
</project>

Having said that, people don't necessarily want to rewrite their filesets 
in terms of selectors just to find obsolete files. Perhaps the usability 
benefits make it worth adding fileset references to <present> (and 
<depend>, I guess) for 1.6.

Anyone else have an opinion on this?



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message