ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Atherton <br...@callenish.com>
Subject RE: How do I delete files using a mapper?
Date Sun, 26 May 2002 21:56:33 GMT
At 11:45 AM 5/25/02 -0700, Chris Bailey wrote:
>Not to beat this silly (or maybe), but how would I specify this when I want
>to map between a source file in one dir, and a target in another, where I'm
>deleting the target?

Switch your thinking around. You are testing the source files for deletion. 
The targets only indicate whether the source will be deleted or not.

You specify the source files with the fileset "dir" attribute and 
includes/excludes, and the target directory in the "targetdir" attribute of 
the present selector. The source files will be all the create_*.sql files, 
and the target files the *.dm files.


><delete>
>   <fileset dir="foo" includes="create_*.sql">
>     <presentselect targetdir="foo/datamodel">
>       <mapper type="glob" from="*.dm" to="create_*.sql"/>
>     </presentselect>
>   </fileset>
></delete>

Reverse the from and to attributes on the mapper. Also, the directory 
structures will have to be the same, so for example 
"foo/this/that/create_theother.sql" will have to have an equivalent 
"foo/datamodel/this/that/theother.dm" file to be deleted.

If you need to change the directory structure too, you should take a look 
at the regexp Mapper instead.



--
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