ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: EasyAnt phases
Date Thu, 13 Nov 2008 19:34:31 GMT
On Thu, Nov 13, 2008 at 1:08 PM, Bruce Atherton <bruce@callenish.com> wrote:
> Conceptually I agree with you, but I think we need to recognize why people
> would want this and to validate their concerns.
>
> Consider these targets:
>
>  <target name="full-build" depends="clean,compile,jar-files">...</target>
>  <target name="update-build" depends="compile,jar-files">...</target>
>
> Whether or not "clean" is a dependency of "compile" depends on the context
> "compile" is executed in. Now, it is possible to work around this but I am
> fairly sure that using dependencies as described above is a common
> implementation pattern for our users. I know that I have used it in the
> past, and probably will again. Sacrilege, I know. :-)

Very good example Bruce, thanks. I also relied on the ordering in this
case, and in my haste to advocate against relying on the ordering I
forgot about it ;)

The work around involves creating additional targets, which is
inconvenient and leads to my dreaded "spaghetti Ant code".

This would be cleanly solved by the proto shown once a long time ago
by Conor (I believe), where dependencies could be specified *inside*
the target body. This was a little mind-bending at first, but then you
realize it's like creating implicit unnamed targets, and it solves the
ordering issue nicely. Your above example would then become:

<target name="full-build">
  <!- pre-clean stuff>
  <dependencies targets="clean"/>
  <!- post-clean stuff>
 <dependencies targets="compile, jar-files"/>
</target>

--DD

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


Mime
View raw message