FailNL task
Fails an Ant build with a national language (NL) message of the user locale, in the International Components for Unicode (ICU) format, which is identified by a given key from a resource bundle accessible from the class loader.
Parameters
Attribute | Description | Required |
---|---|---|
bundle | The resource bundle to load properties from. | Yes |
key | The key of the property to be loaded from the resource bundle. | Yes |
if | The name of the property for which if set, this task will cause a build failure. | No; Only one of these properties or the nested
Condition element may be specified |
unless | The name of the property for which if not set, this task will cause a build failure. |
Nested elements
- Arg
Specifies an argument with which patterns in the message are replaced.
Attribute Description Required value The value of the argument. Yes
- Condition
Specifies the condition for which if it is met, this task will cause a build failure. Refer to Conditions in the Apache Ant manual for a list of conditions that can be used in this nested element.
Examples
The following example fails the Ant build with an NL message of
the user locale that is identified by the
ERR_WSADMIN
property of the
wcbd-deploy-messages
resource bundle accessible from the class
loader.<failNL bundle="wcbd-deploy-messages" key="ERR_WSADMIN" />
The following example fails the Ant build with an NL message of the user locale that is
identified by the
ERR_XMLTRANSFORM
property of the
wcbd-deploy-messages
resource bundle accessible from the class loader, while
substituting the {0}
pattern in the message with the value of the
wca.logger.output.dir
property.<failNL bundle="wcbd-deploy-messages" key="ERR_XMLTRANSFORM">
<arg value="${wca.logger.output.dir}" />
</failNL>
The
following example fails the Ant build with an NL message of the user locale that is identified by
the
ERR_FILE_NOT_FOUND
property of the wcbd-build-messages
resource bundle accessible from the class loader, while substituting the {0}
pattern in the message with ${basedir}/build.properties
, if the file
${basedir}/build.properties does not exist.
<failNL bundle="wcbd-build-messages" key="ERR_FILE_NOT_FOUND">
<arg value="${basedir}/build.properties" />
<condition>
<not>
<available file="${basedir}/build.properties" type="file" />
</not>
</condition>
</failNL>