ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <ddevie...@gmail.com>
Subject Re: How to force Ant to perform all targets even when not necessary?
Date Sat, 24 Jan 2009 20:37:28 GMT
On Sat, Jan 24, 2009 at 4:52 AM, Ben Stover <bxstover@yahoo.co.uk> wrote:
> One of the features of Ant is to only process (dependent) targets if it is necessary.
> Otherwise the existing products are used for subsequent steps.

It depends by what you mean by "dependent" targets.

If we consider target A which depends on B and C, both of which depend
on D, Ant will notice that D needs to be run only once, so the targets
executed with be [D, B, C, A] in that order (using the default
executor). If your intent is to have [D, B, D, C, A] executed, Ant
doesn't support this out of the box. You could write your own
executor, an Ant extension point which allows you more control over
how/when targets are executed, but you'll have to write Java code and
specify the classname of the executor on the Ant command line.

If you the other hand you meant to force the *tasks* inside the
targets to force "executing", as in foregoing their usual dependency
analysis to avoid doing unnecessary work, there's no standard way to
achieve that either. Some tasks have an attribute to force processing,
others don't. But generally, a best practice is to put all build
artifacts into a single build/ directory, and having a clean target
that deletes this directory; calling the clean target first implicitly
means all tasks will see missing "target" files, which is in effect an
implicit "force".

I'm not sure that's what you meant though. --DD

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


Mime
View raw message