ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From etienne_frejaville <>
Subject Pb with copy and present selector
Date Tue, 16 Aug 2005 17:04:03 GMT

I'm trying desperately to overwrite files from a source directory if they exist in a target
The source and target directory have not the same hierarchy, source is flat and directory
has sublevels.

Example of hierarchy:



and I want that the names of the files to copy are obtained from dest and copied from source
to dest, i.e :

root/source/A.html copied on root/dest/x/A.html
root/source/B.html copied on root/dest/y/B.html
root/source/C.html copied on root/dest/y/C.html

In shell, it's easily done like that:

cd root/dest
for i in */*.html
 cp ../source/`basename $i` $i

With ant, I've tried:

(launched from root directory) :

		<copy todir="dest" verbose="true">
			<fileset dir="source">
			   <present targetdir="dest">
                                <mapper type="regexp" from="(.*)\\(.*).html$$" to="\2.html"/>

But it doesn't copy anything.
Actually, I'm quite puzzled with fileset and mappers.
Any idea? I've found very little literature on that subject.

As a corollary question, is there any tool that allows debugging such tasks, showing what
is matched on each task .?

Thanks in advance.

Coface facilite les echanges entre les entreprises partout dans le monde. Pour cela, elle
offre a toutes les entreprises des solutions pour gerer, financer et proteger leur poste client,
en leur permettant d'externaliser tout ou partie de la gestion et des risques lies a leurs
relations commerciales. Coface est notee AA par Fitch Ratings et Aa3 par Moody's.
Pour en savoir plus,

Coface facilitates business-to-business commerce worldwide. It offers all size companies an
array of solutions to manage, finance, and protect their accounts receivables affording them
the option of fully or partly outsourcing trade relationship management and attendant risks.
Coface is rated AA by Fitch ratings and Aa3 by Moody's.
More about Coface,

- Soyez conscient que notre systeme Anti-Spam peut parfois rejeter des messages, soit parce
que certains mots et types de fichiers ne sont pas acceptes, ou bien parce que le mail n'a
pas ete identifie correctement.
- Be aware that from time to time our Anti-Spam system may reject mails either because some
words and types of files are not allowed or because mails are misidentified. 

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

View raw message