ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Bailey" <ch...@codeintensity.com>
Subject RE: How do I delete files using a mapper?
Date Fri, 24 May 2002 23:47:54 GMT
Great!  I am guessing that Ant 1.5 will be far enough along for me to switch
to it when I'm done getting the initial conversion (I'm converting a
complicated make based project to Ant) that I can rewrite a task or two
using that stuff.  Thanks!

-----Original Message-----
From: Bruce Atherton [mailto:bruce@callenish.com]
Sent: Friday, May 24, 2002 4:30 PM
To: Ant Users List
Subject: Re: How do I delete files using a mapper?


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" />
         </present>
     </fileset>
</delete>

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:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>



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


Mime
View raw message