This task captures Ant build messages and allows them to be searched or displayed, and allows conditional Ant build failures depending on whether or not a specified string is in the captured build messages.
Parameters
| Attribute | Description | Required |
|---|---|---|
| action | The capturing action to be performed | Yes. May be one of the following:
|
| MessageLevel | The level of Ant build messages to capture | No, default is Information. May be error, warning, information, debug, or verbose. |
| SearchString | A string to be searched for (only valid for findMessage or FailOnErrorMessagePresent or FailOnErrorMessageMissing) | Yes (for search actions) |
| PropertyMessagesName | Property to receive Get/Search action Message result | No, default is BuildMessages |
| ErrorPrefixMessage | A string prefix to be output before any FailOnError failure message | No |
Examples
<captureBuildMessages action="start"
messagelevel="information" />
<projectBuild ProjectName="myProject" />
<captureBuildMessages action="stop" />
<captureBuildMessages action="getAllMessages"
propertymessagesname="BuildMessages" />
<echo message="projectBuild:
build messages=${BuildMessages}" />
<captureBuildMessages action="findMessage"
searchstring="${TargetSearchString}"
propertymessagesname="FoundMessages" />
<echo message="projectBuild: search found
target messages=${FoundMessages}" />
<captureBuildMessages action="failOnErrorMessagePresent"
searchstring="${ErrorMessageString}" />