ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: How to create multiline property?
Date Tue, 09 Jul 2002 03:54:24 GMT
--- Alexey Solofnenko <> wrote:
> I want to put default Log4J configuration into a property. It contains
> several lines and "<>" characters. Is there a way to do it without
> creating a separate file?

This is only way I can think of:
  <property name="ls" value="${line.separator}"/>
  <property name="multi.line"
    value="A property${ls}with multiple lines,${ls}and &lt; and &gt;

(Ugh -- if that 'value' line wraps, I don't mean for it to.)

  <target name="echoit">
    <echoproperties prefix="multi."/>
    <exec executable="echo">
      <arg value="${multi.line}"/>

You'll get:
     [echo] A property
     [echo] with multiple lines,
     [echo] and < and > symbols.
[echoproperties] #Ant properties
[echoproperties] #Mon Jul 08 20:55:28 GMT+01:00 2002
[echoproperties] multi.line=A property\r\nwith multiple lines,\r\nand <
and > symbols.
     [exec] A property
     [exec] with multiple lines,
     [exec] and < and > symbols.



Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free

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

View raw message