ant-user mailing list archives

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

Hi,

-----Original Message-----
From: Steve Loughran [mailto:stevel@apache.org] 
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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message