by
Version 1.0 - 2000/11/02
Ant provides an optional task for editing property files. Thes is very useful when wanting to make unattended modifications to configuration files for application servers and applications. Currently, the task maintains a working property file with the ability to add properties or make changes to existing ones. However, any comments are lost. Work is being done to make this task a bit more "human friendly".
| Attribute | Description | Required |
| file | Location of the property file to be edited | Yes |
| comment | Header for the file itself | no |
Use nested <entry>
elements to specify actual modifcations to the property file itself
| Attribute | Description | Required |
| key | Name of the property name/value pair | Yes |
| value | Value to set for the key the property name/value pair | Yes |
| type | Manipulate the value as type: int, date | No, but must be used if opertion attribute used |
| operation | If type is date, this cane be "now" or "never". If the type is int, only "-" and "+" may be used. | No |
The following changes the my.properties file. Assume my.properties look like:
<propertyfile file="my.properties" comment"My properties" > <entry key="akey" value="avalue" /> <entry key="adate" type="date" operation="now"/> <entry key="anint" type="int" operation="+"/> </propertyfile>