There is another possibility.
I posted a little example on jGuru´s Ant-FAQ
http://www.jguru.com/faq/view.jsp?EID=1099123
with use of mutliple entries.
Your properties would be something like
services=service-1,service-2,...
service-1.name=
service-1.host=
service-1.port=
service-2.name=
...
Jan
> -----Original Message-----
> From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> Sent: Thursday, July 10, 2003 1:59 PM
> To: user@ant.apache.org
> Subject: RE: Check for server availability
>
>
> > I guess I could use foreach to iterate through each line of
> > the file, but
> > then I don't see how to split each line into 3 properties:
> > service.name,
> > service.host, service.port.
> > I saw a propertyregex task in ant-contrib, but it is not
> > available in the
> > distribution yes (only in cvs).
>
> You can get the latest binaries from
> http://gump.covalent.net/jars/latest/ant-contrib/
>
>
> > Do you see anyways I could do this. I would actually prefer to avoid
> > ant-contrib (one less file to share), but if there is no choice...
>
> Why not share that?
> But you can use <script> and a StringTokenizer.
>
>
> > I have a second question. Is it planned to include some
> > ant-contrib tasks
> > into the core ant distribution?
>
> There are plans ... but not more :-)
> One aspect is that the distributors have to give their 'ok'
> for donating to
> Apache.
>
>
>
> Jan
>
|