B.15 FailTask

Causes the current build script execution to fail and the script to exit with an (optional) error message.

Table B.17: Attributes

NameTypeDescriptionDefaultRequired
messageStringThe message to display (reason for script abort)."No Message"No
msgStringAlias for message"No Message"No
ifStringName of property that must be set for script to exit.n/aNo
unlessStringName of property that must not be set in order for script to exit.n/aNo

B.15.1 Examples

<!-- Exit w/ message -->
<fail message="Failed for some reason!" />

<!--  Exit if ${errorprop} is defined -->
<fail if="errorprop" message="Detected error!" />

<!-- Exit unless ${dontfail} prop is defined. -->
<fail unless="dontfail" message="Detected error!" />