ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Duncan Davidson" <james.david...@eng.sun.com>
Subject Re: ANT's strange semantics and proposed change
Date Fri, 25 Feb 2000 23:27:18 GMT
>   As I've already mentioned twice now, I'd like to create a task of the
> form:
>
> <ForEach variable="i" list="subprojectA:subprojectB" separator=":">
> <Ant dir="${i}" target="clean" />
> <Ant dir="${i}" target="main" />
> </ForEach>

-1. Solid. For reasons I've already put forward.

> This means that properties get set in static order, not dynamic order
(even
> between targets).  This means that the execute() method of a task cannot
> change the value of an attribute of another task.

Why should it? The data file is a static representation of a project.

> To see this in action, rename the "init" target of your ant build.xml to
> "myinit" (the "init" target is treated specially).  Now move this target
to
> the end of the build file.  Finally add this special target to all the
> other target's dependancy lists.  Given that this target is in all the
> other target's dependancy lists you would expect it to execute first and
> set all the properties correctly.  What you will actually see is that none
> of the properties will be set correctly.  This is because the "myinit"
> target is last in the build file.

For the record, I don't like the fact that the init target is treated
special. If such behavior is desired the entry point target should set a
depends on that target. MHO. And if the myinit target is first in every
other targets dependancy list, it *should* be executed first. For it not to
be is a bug.

.duncan


Mime
View raw message