Have you considered using the SCRIPT task?  This sounds like a task that requires a bit of program logic.
You could write Javascript that set a variable to be either "NIGHTLY-YYYY-MM-DD" or "VERSION-NO" and then do the replace using that variable that.
In some seperate files you could increment the version number.
 -----Original Message-----
From: Aarti Chandnani [mailto:Aarti.Chandnani@XUMA.com]
Sent: Wednesday, May 02, 2001 10:04 AM
To: 'ant-user@jakarta.apache.org'
Subject: same old question(slightly long)

I have a manifest file
which has in it the line say,


I use this manifest file when I build my jar files.

Now if its a nightly build , I need the file to say:


But if its a release, I need it to say Package-Version:2.2 (next release 2.1 + 1)

I could accomplish this by Propertyfile but it replaces the ":" with "="

2nd option: replace. But this would mean i search for  2.1 nd replace with "nightly" (hardcoded)
and then if there was to be a release ,  i now search for and replace  2.2 with "nightly"
also i have lots of projects being built with diff versions.  So many ant files  will have to be maintained.
SO i thought of having something like have Package-Version:which in all manifest files  and then ant replaces which to Nightly

But this doesnt work since I lose my version information if i write Package-Version:which in all manifest files.

I dont want to do a echo cause i will have a lot of code hardcoded in ANT xml.

Any way out ???

p.s. was I clear?