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: Simple manipulation of a property value
Date Thu, 28 Oct 2004 05:45:07 GMT
AntContribs <propertyregexp>.

Jan

> -----Urspr├╝ngliche Nachricht-----
> Von: Kris Read [mailto:kris.read@gmail.com]
> Gesendet am: Mittwoch, 27. Oktober 2004 19:49
> An: Ant Users List
> Betreff: Re: Simple manipulation of a property value
> 
> This is a hack, but: 
> 
> PropertyFile to persist the property to a file. 
> 
> Replace or ReplaceRegExp to alter the value. 
> 
> Then reload from the file. 
> 
> 
> 
> On Wed, 27 Oct 2004 10:04:33 -0400, Erik Hatcher
> <erik@ehatchersolutions.com> wrote:
> > On Oct 27, 2004, at 8:56 AM, Benoît Lubek wrote:
> > > Hi,
> > >
> > > I have a property :
> > >
> > > <property name="version" value="v1.0.2" />
> > >
> > > And I'd like to manipulate it a bit, ie, change the "." 
> to "_" (so it
> > > can be used for a cvs tag). So I'd like to have a 
> property with the
> > > value "v1_0_2".
> > >
> > > Is there a way to do that with the core tasks? I realize 
> it would be
> > > easy to do it with the <script> task, but I would prefer 
> to avoid the
> > > need to depend on another jar for our project... Any idea?
> > 
> > There is no way to do this without some scripting, that I know of.
> > However, an alternative is to keep the pieces of that property
> > separate:
> > 
> >         <property name="part1" value="1"/>
> >         <property name="part2" value="0"/>
> >         <property name="part3" value="2"/>
> > 
> >         <property name="version" 
> value="v${part1}.${part2}.${part3}"/>
> > 
> >         <property name="version_with_underscores"
> > value="v${part1}_${part2}_${part3}"/>
> > 
> > Erik
> > 
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > 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