Welcome, Guest
Username Password: Remember me

How to put new line in apache ant message
(1 viewing) (1) Guest
Apache Ant
  • Page:
  • 1

TOPIC: How to put new line in apache ant message

How to put new line in apache ant message 1 year, 9 months ago #310

  • rajeshkumar
  • OFFLINE
  • Moderator
  • I love software configuration management
  • Posts: 370
  • Points: 44470
  • Karma: 4
  • Honor Medal 2009
How to put new line in Apache Ant echo task and mail task:

Answer:
line.separator is Java System Properties which can be used for this purpose.
Found the solution (tried with Ant 1.7.0):

1. You might wrap the message-texts within the XML file.
2. If you put ${line.separator} in front of the line every space before that line separator will be trimmed away.


Example Program
:

<project default="play" name="sandbox">
<target name="-private">
<echo message="Private message... never reached."/>
</target>

<target name="play">
<echo message="Lorem Ipsum Dolor"/>
<echo message="----------"/>
<echo message="Lorem${line.separator} Ipsum${line.separator} Dolor"/>
<echo message="----------"/>
<echo message="Lorem ${line.separator}Ipsum ${line.separator}Dolor"/>
<echo message="----------"/>
<fail message="Failure Title ${line.separator} Ipsum ${line.separator} Dolor"/>
</target>
</project>


Note:
If new properties get added (it happens), expect them to appear under the "ant." and "org.apache.tools.ant" prefixes, unless the developers have a very good reason to use another prefix. Accordingly, please avoid using properties that begin with these prefixes. This protects you from future Ant releases breaking your build file.
Regards,
Rajesh Kumar
Build and Release Engineer
My Blog: community.scmgalaxy.com/pg/profile/rajeshkumar
  • Page:
  • 1
Time to create page: 0.46 seconds

     
    
Home Forum