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>

This produces the following output:

> ant runTest
Buildfile: build.xml

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

Total time: 0 seconds