ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Les Hughes <leslie.hug...@rubus.com>
Subject RE: Incrementing Properties
Date Thu, 10 May 2001 09:11:00 GMT

Hi,

Funny that...I thought of the same thing on the train last night :-)

Thanks anyway,

Les

> -----Original Message-----
> From: Nico Seessle [mailto:nico@apache.org]
> Sent: 10 May 2001 07:49
> To: ant-dev@jakarta.apache.org
> Subject: Re: Incrementing Properties
> 
> 
> ----- Original Message -----
> From: "Les Hughes" <leslie.hughes@rubus.com>
> To: "Ant-Dev@Jakarta. Apache. Org (E-mail)" 
> <ant-dev@jakarta.apache.org>
> Sent: Wednesday, May 09, 2001 6:09 PM
> Subject: Incrementing Properties
> 
> 
> > Hi All,
> >
> > I've been playing with the propertyfile task which is 
> pretty neat but what
> I
> > really need to do is to be able to increment a property. I 
> could roll this
> > into the p4counter code but is there another way of doing 
> this and/or
> > shouldn't it be something available to all properties? It 
> seems crazy to
> > have to write the props to a file via propertyfile, 
> increment, re-write
> the
> > file then re-import it.
> >
> 
> You could use the script-task as follows:
> 
>     <script language="javascript"> <![CDATA[
>         var buildNumber =
> parseInt(myProject.getProperty('product.build.minor'));
>         if (isNaN(buildNumber)) buildNumber = 0;
>         buildNumber = buildNumber + 1;
>         myProject.setProperty('product.build.minor', buildNumber);
>     ]]></script>
> 
> Nico
> 
> 

Mime
View raw message