ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <levylamb...@tiscali-dsl.de>
Subject Re: Rename directory
Date Tue, 15 Apr 2003 22:22:02 GMT
Basically, you can do this with the move task, using a nested mapper.
Pay attention :
here follows an example which works I have tested under Windows, and should
also work under Unix
NB : I have tested this against ant CVS head

       <!-- add a backslash before the file separator on windows -->
       <condition property="regexp.file.separator"
value="\${file.separator}">
           <os family="windows"/>
       </condition>
       <!-- properties are immutable, so this will only be set on non
Windows OS -->
       <property name="regexp.file.separator" value="${file.separator}"/>
  <property name="fromregexp"
value="^(.+)${regexp.file.separator}fr${regexp.file.separator}(.+)"/>
  <property name="toregexp" value="\1${regexp.file.separator}\2"/>
  <echoproperties/>
  <move todir="a-project/translation">
   <fileset dir="a-project/translation">
    <include name="**/fr/*_fr.str"/>
   </fileset>
   <mapper type="regexp" from="${fromregexp}" to="${toregexp}"/>
  </move>


----- Original Message -----
From: "Joylene Nettleton" <joylene.nettleton@peregrine.com>
To: <user@ant.apache.org>
Sent: Tuesday, April 15, 2003 9:40 PM
Subject: Rename directory


> I have some files in a partially known directory path,
> c:\oaa-41\projects\a-project\translation\...\fr\*_fr.str.  I don't know
the
> path for "...", which could be more than one directory deep.  I want to
move
> those *_fr.str file to one level up,
> c:\oaa-41\projects\a-project\translation\...\*_fr.str.  Could anyone help?
>
> Thanks much.
>
> --Joylene
>


Mime
View raw message