ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SimonRichards...@hbosts.com
Subject RE: increment integer task
Date Fri, 20 Dec 2002 07:33:12 GMT
You could adapt this for your needs..

<target name="update_manifest">
<script language="javascript"> <![CDATA[
function updVersion(s) {
	// version numbers in the for x.y.z (major.minor.micro)
	majorIx = s.indexOf('.');
	minorIx = s.indexOf('.',majorIx + 1);
	major   = s.substring(0, majorIx);
	minor   = s.substring(majorIx + 1, minorIx);
	micro   = s.substring(minorIx + 1, s.length());
	micro ++;
	return major + "." + minor + "." + micro;
}
// 
// some stuff to get thisVersionLine from a manifest file
// 
if (thisVersionLine.indexOf('.') > 0) { // is it a version line
	newVersionLine  = updVersion(thisVersionLine);
	manifest.setProperty("manifest.oldValue",thisVersionLine);
	manifest.setProperty("manifest.newValue",newVersionLine);
}

</script>
<echo message="manifest.oldValue = ${manifest.oldValue}"/>
<echo message="manifest.newValue = ${manifest.newValue}"/>
</target>

> -----Original Message-----
> From: Euan Guttridge [mailto:EGuttridge@buildonline.com]
> Sent: 19 December 2002 16:13
> To: 'Ant Users List'
> Subject: increment integer task
> 
> 
> Has anyone succesfully got the "math" task running in Ant? 
> (from the add on
> in Antelope). Or.. does anyone know of another task which 
> will increment an
> integer variable?
> 
> 
> Thanks,
> Euan
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ant-user-help@jakarta.apache.org>
> 
> 
> 

-- 

------------------------------------------------------------------------------
For more information on HBOS Treasury Services, please visit http://www.HBOSTS.com

Or for details of our online FX & Deposit services, please go to http://www.HBOSdeal.com

HBOS Treasury Services plc is part of the HBOS Group, which also includes Halifax plc and
Bank of Scotland.
Registered Office: 33 Old Broad Street, London EC2N 1HZ. Registered No. 2692890. Registered
in England.
Regulated by the Financial Services Authority.

The information contained in this message is confidential and is intended for the addressee
only. If you have received this message in error or there are any problems please notify the
originator immediately. The unauthorised use, disclosure, copying or alteration of this message
is strictly forbidden. This mail and any attachments have been scanned for viruses prior to
leaving the HBOS Treasury Services plc network. HBOS Treasury Services plc will not be liable
for direct, special, indirect or consequential damages arising from alteration of the contents
of this message by a third party or as a result of any virus being passed on.

HBOS Treasury Services plc reserves the right to monitor and record e-mail messages sent to
and from this address for the purposes of investigating or detecting any unauthorised use
of its system and ensuring its effective operation.

==============================================================================


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message