echo
Description
Writes a message to the console, either from the "message" attribute or from inline content. The message can optionally be written to file.
Parameters
Table 4. Parameters
Attribute | Type | Description | Required |
---|---|---|---|
message | string | The message to output. | false |
file | string | Optional name of a file to write to. | false |
append | bool | If writing to a file, this decides whether the file will be overwritten or appended. Default is false (overwrite). | false |
if | bool | If true, the task will be executed, otherwise it will be skipped. The default is true. | false |
unless | bool | The opposite of if. If false, the task will be executed, otherwise it will be skipped. The default is false. | false |
Examples
Example 6. Writing "Hello, World!" to the console
<echo message="Hello, World!" />
<echo>Hello, World!</echo>
Example 7. Appending the current time to test.log
<echo message="${ date::get-current-time() }"
file="test.log"
append="true" />