ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Liu <stevec...@gmail.com>
Subject Re: Trouble with simple for loops
Date Fri, 06 Feb 2009 13:25:08 GMT
sorry to belabor the point, but I think I'm still not quite getting it:
>No, thats right.
>If you want to use <for> you have to have Ant 1.6 or higher (like
>current 1.7.1).
><foreach> e.g. works with older Ant versions (like 1.5).

But I can't use <for> but only <ac:for>, right? I understand that the
difference is just the namespace. But, based on the example given in the doc
page (basically the thing I had problems with) I didn't need the namespace
at all. so, how would I get it to work like that (on 1.6 or higher)?

btw, I should have mentioned my ant version: 1.7.1

Thanks,
Steve

On 2/6/09, Jan.Materne@rzf.fin-nrw.de <Jan.Materne@rzf.fin-nrw.de> wrote:
>
> >Thanks, that seems to work (missing a </ac:for> tho). I assume
> >that I would do the same for <foreach>?
>
>
> Yes. AC has a nice pattern:
> - provide a propertiesfile with tasks for Ant < 1.6
> - provide a antlib.xml with tasks for Ant >= 1.6, which includes the
> properties file
>
> (If you write your own tasks, you dont need that any more, because 1.6
> is 'old' ;)
>
>
>
>
> >I have a dumb question, according to this page:
> >http://ant-contrib.sourceforge.net/tasks/tasks/for.html
> ><for> is valid for ant 1.6 or higher... so the doc is wrong?
>
>
> No, thats right.
> If you want to use <for> you have to have Ant 1.6 or higher (like
> current 1.7.1).
> <foreach> e.g. works with older Ant versions (like 1.5).
>
> But there are two differences
> - how does the task use Ant API --> which version of Ant is required
> - how is the task declared --> properties/antlib.xml
>
>
> Jan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message