ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: How to create multiline property?
Date Tue, 09 Jul 2002 03:54:24 GMT
--- Alexey Solofnenko <A.Solofnenko@mdl.com> 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;
symbols."/>

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

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

You'll get:
echoit:
     [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.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message