ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: how to echo propertyset to file?
Date Mon, 02 Jun 2008 09:43:21 GMT
 

-----Original Message-----
From: Daniel Gröndal [mailto:daniel.grondal@ericsson.com] 
Sent: Monday, June 02, 2008 11:30 AM
To: user@ant.apache.org
Subject: how to echo propertyset to file?

/*
Hi all!
 
I have a problem echoing a set of properties to a specified file. I have a number of properties
which have a common prefix, but the exact number is undefined, so these properties are selectable
by a propertyset by I do not know the exakt number.

[ ... ] 

<propertyset id="midlet_properties">
	<propertyref prefix="MIDlet_"/>
</propertyset>

But how do I echo this propertyset to the specified file? I tried using <echoproperties>
(I know this might not be the intention of echoproperties). That gives me some additional
lines at the top of the file that I do not want. I also tried using pathconvert but that really
needs a path, not a propertyset. 
*/


Just use =
<echo file="file/to/dump/to"props.ext">${toString:midlet.properties}</echo>

/*
Do I have to use foreach from ant-contrib? Are there any other (reasonable) way to do this?
Any suggestions are more than welcome right now.
*/

use antcontrib <for> to get it line separated, something like=

<for list="${toString:midlet.properties} param="prop">
 <sequential>
   <echo file="file/to/dump/to/props.ext>@{prop}${line.separator}</echo>
 </sequential>
</for>


Regards, Gilbert

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


Mime
View raw message