ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Fail task
Date Fri, 16 Aug 2002 20:04:20 GMT
I'll just add that this technique does not work with <echo> when appending
to a file, because it doesn't append the right type of line terminator. Had
to resort to the ugly thing below:

    <echo file="${mowi-cvs-manifest}"
          append="yes" />
    <echo file="${mowi-cvs-manifest}"
          message="Build Machine:    ${env.COMPUTERNAME}${nl}"
          append="yes" />
    <echo file="${mowi-cvs-manifest}"
          message="Base Directory:   ${basedir}${nl}"
          append="yes" />
    <echo file="${mowi-cvs-manifest}"
          message="Start time:       ${TIME_NOW} on ${TODAY}${nl}"
          append="yes" />
    <echo file="${mowi-cvs-manifest}"
          message="Java VM Version:  ${java.vm.version}${nl}"
          append="yes" />

instead of the way nicer:

    <echo file="${mowi-cvs-manifest}"
Build Machine:    ${env.COMPUTERNAME}
Base Directory:   ${basedir}
Start time:       ${TIME_NOW} on ${TODAY}
Java VM Version:  ${java.vm.version}

because opening the generated (on Windows) file with Notepad, I get the
dreaded little squares, and the formatting is awful. The ugly technique
presented first was the only way to have it display correctly.

Not directly linked to <fail>, but related to the same issue (output of the
tag's content). --DD

PS: And no, the build.xml doesn't have Unix line terminator, but Windows

-----Original Message-----
From: Diane Holt [] 
Sent: Friday, August 16, 2002 2:28 PM
To: Ant Users List
Subject: RE: Fail task

--- Dominique Devienne <> wrote:
> Better yet, use the platform independent one, i.e. ${line.separator}
> (that I personally usually alias to something shorter, like ${nl}.

Or you could just nest your message under <fail>, instead of trying to
stick it all in the 'message' attribute:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message