ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <>
Subject RE: how can I copy a directory of files to lower case equivalents?
Date Tue, 02 Oct 2007 12:59:04 GMT


-----Original Message-----
From: Steve Loughran [] 
Sent: Tuesday, October 02, 2007 2:36 PM
To: Ant Users List
Subject: Re: how can I copy a directory of files to lower case

The ant-approved way would be a <copy> with an appropriate mapper listed

as a nested element. This gives copy the mapping from input filenames to

output names, lets it do the copying and dependency management as 
normal. You just provide the renaming logic .

I dont see one, but I do see in the manual the <scriptmapper> example, 
which (ant1.7+ only) would let you do what you want in a few lines

  <copy todir="${dist.dir}/images">
      <fileset dir="images"/>
     <scriptmapper language="javascript">

If you are running on java6, javascript is built in -no need for extra 
JARs to get scripting working.

Case conversion does sound like a common use could always 
write the java mapper and provide it with tests as an ant enhancement 

i found an example with beanshell in the manual of ant 1.6.5.,
see my previous post.
But the problem is, with that snippet directorynames are lowercased too,
what if i want only filenames to lowercase but not the dirnames ?!

I tried to check that with your javascript mapper above, but it doesn't
run for me (ant 1.6.5)

Regards, Gilbert

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

View raw message