Thursday, May 07, 2009

Ant: multi-line message/echo

Use the ${line.separator} property to split up long echo or message values. An example is below.

<target name="runTest" description="Run a test!">
 <echo>This is the first line.${line.separator}This is the second line.</echo>
</target>

This produces the following output:

> ant runTest
Buildfile: build.xml

runTest:
     [echo] This is the first line.
     [echo] This is the second line.

BUILD SUCCESSFUL
Total time: 0 seconds