The IniFileTask is inspired by the Ant-Contrib IniFile and
can be used to build and edit .ini files.
Table C.35: Attributes
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
dest | string | The name of the .ini file to write to. If not specified, the source file will be modified instead. | none | No |
haltOnError | boolean | Should the build fail when problems occur? | false | No |
source | string | The name of the .ini file to read from. If not specified, the dest file will be used instead. | none | No |
remove
Use to remove either a specific key or section from an .ini file
Table C.36: Attributes
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
section | String | Name of the section. | n/a | Yes |
property | String | Name of the key to remove. If not specified the entire section is removed. | n/a | No |
set
Use to set a key in a section to a specific value
Table C.37: Attributes
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
section | String | Name of the section. | n/a | Yes |
property | String | Name of the key/property. | n/a | yes |
operation | String | The operation to perform on the existing value, which must be numeric. Possible values are "+" and "-", which add and subtract 1, respectively from the existing value. If the value doesn't already exist, the set is not performed, triggering an error. | n/a | No, if operation is specified. |
value | String | The new value for the property. | n/a | No, if operation is specified. |
<inifile
haltonerror="no"
dest="${project.basedir}/application/configs/application.ini">
<set section="production" property="buildTimestamp" value="${DSTAMP}${TSTAMP}" />
<set section="production" property="buildNumber" operation="+" />
<remove section="development : staging" />
</inifile>