Hi,

-----Original Message-----
From: Steve Loughran [mailto:[EMAIL PROTECTED] 
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
equivalents?


/*
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">
      self.addMappedName(source.toLowerCase());
    </scriptmapper>
  </copy>

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 case...you could always 
write the java mapper and provide it with tests as an ant enhancement 
bugrep.
*/

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to