ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Atherton <>
Subject Re: How do I delete files using a mapper?
Date Fri, 24 May 2002 23:30:08 GMT
At 11:18 AM 5/24/2002 -0700, Chris Bailey wrote:
>I have a task that turns .xml files into .java files, that reside in the
>same source dir as the rest of my .java files.  But, I want to be able to
>"clean" those generated java files.  So, in my clean target I'd like to use
>the delete task, but with a Mapper.  But, delete doesn't support Mappers.
>So, what is the proper way to do such a thing?

Although I'm sure Diane's method would work, if you are using the latest 
Ant from CVS you could also use the <present> selector. Off the top of my 
head (and untested), something like this:

<delete dir="${src}">
     <fileset dir="${src}" >
         <include name="**/*.java"/>
         <present targetdir="$src">
            <mapper type="glob" from="*.java" to="*.xml" />

If you are using 1.5 Beta1 then you have to use <presentselect> instead of 
<present>, but that should change with the next Ant release.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message