ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: os-independent directory mapping in copy task?
Date Thu, 24 Mar 2005 10:42:31 GMT
just an idea ... could you use ${path.separator} ?

Jan

> -----Ursprüngliche Nachricht-----
> Von: Peter Reilly [mailto:peterreilly@apache.org]
> Gesendet am: Donnerstag, 24. März 2005 11:20
> An: Ant Users List
> Betreff: Re: os-independent directory mapping in copy task?
> 
> Ant 1.6.3 will add a new attribute to the regexp mapper:
> handledirchar
>     If this is specified, the mapper will treat a \ character in a 
> filename as a / for the purposes of matching.
>     This attribute can be true or false, the default is false. This 
> attribute is useful for cross-platform build files.
>     /Since ant 1.6.3.
> 
> The example given is:
> /
> 
>         <regexpmapper from="${basedir}/d/e/(.*)" to="\1" 
> handledirchar="yes"/>
> 
> And the example is mean to work on both unix and windows.
> 
> Peter
> 
> Peter Nabbefeld wrote:
> 
> >
> > Hello,
> >
> > I'm using the copy task to map a file name into a directory 
> structure:
> >
> > <copy todir="...">
> >     <fileset dir="...">
> >         <include name="**/*.txt"/>
> >     </fileset>
> >     <mapper type="regexp" 
> > 
> from="^([a-zA-Z][a-z_A-Z0-9]*)\\([A-Z][a-zA-Z0-9]*)_([A-Z][a-z
> A-Z0-9]*)_([A-Z][a-zA-Z0-9]*)_([\w]+).txt$$" 
> > to="\1/\2/\3/\4/\5.txt"/>
> > </copy>
> >
> > My problem with this is, that I've to use the backslash with w2k 
> > instead of the url type forward slash, so my script isn't 
> > platform-independent. I'd prefer to use something like
> >
> > <mapper type="regexp" 
> > 
> from="^([a-zA-Z][a-z_A-Z0-9]*)${java.file.separator}([A-Z][a-z
> A-Z0-9]*)_([A-Z][a-zA-Z0-9]*)_([A-Z][a-zA-Z0-9]*)_([\w]+).txt$$" 
> > to="\1/\2/\3/\4/\5.txt"/>
> >
> > This doesn't work. Does anybody know, how to solve this problem?
> >
> > Kind regards
> >
> > Peter nabbefeld
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message