C.41 IniFileTask

The IniFileTask is inspired by the Ant-Contrib IniFile and can be used to build and edit .ini files.

Table C.47: Attributes

NameTypeDescriptionDefaultRequired
deststringThe name of the .ini file to write to. If not specified, the source file will be modified instead.noneNo
haltOnErrorbooleanShould the build fail when problems occur?falseNo
sourcestringThe name of the .ini file to read from. If not specified, the dest file will be used instead.noneNo

C.41.1 Supported Nested Tags

  • remove

    Use to remove either a specific key or section from an .ini file

    Table C.48: Attributes

    NameTypeDescriptionDefaultRequired
    sectionStringName of the section.n/aYes
    propertyStringName of the key to remove. If not specified the entire section is removed.n/aNo

  • set

    Use to set a key in a section to a specific value

    Table C.49: Attributes

    NameTypeDescriptionDefaultRequired
    sectionStringName of the section.n/aYes
    propertyStringName of the key/property.n/aYes
    operationStringThe 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/aNo
    valueStringThe new value for the property.n/aNo, if operation is specified.

C.41.2 Example

<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>