ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <>
Subject RE: AINASL! Help with Parsing Files with Ant
Date Wed, 20 Apr 2005 18:08:13 GMT
> This is how my file should look like at anytime or rather build+1
> ---------- content of target file [version.txt] --------------
> [Version]
> Version=5.0
> Build=555
> Date=Wed 04/13/05 05:08:30 PM
> -------------------------------------------------------

Your problem is that this is not a .properties file, which have
a very specific format and semantic. If you maintained 2 files,
one a real property file with the same info, and another in your
desired format, you should be able to do what you want.

- CVS update both files, and version.txt
- Manipulate with <propertyfile>.
- Load the properties (with <property file="">) from the
- Simply <echo> your update version.txt file

  <echo file="version.txt">

You may have to prefix properties when re-loading them,
since Ant properties are immutable.

There are other ways to do this with regular expressions
and the tasks that use them, but I think the dual file
approach above is the simplest, and closest to what you tried.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message