ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Bailey" <>
Subject How do I delete files using a mapper?
Date Fri, 24 May 2002 18:18:29 GMT
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?  e.g. I'd like to do
something pseudo equivalent to:

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

Thus, starting at the top level of the source code hierarchy, and looking
for all .java files that have a corresponding .xml file (where the name,
excluding the file extension) is the same, and deleting the .java file.

I assume I could do this with the apply task, but then it becomes OS
specific, which I'd like to avoid (or I guess I use two apply tasks, with
the OS attribute).

Chris Bailey
Code Intensity
Voice: 916-415-0471             FAX: 508-267-5841

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

View raw message