You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ben Stover <bx...@yahoo.co.uk> on 2009/01/24 11:52:40 UTC
How to force Ant to perform all targets even when not necessary?
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.
However sometimes I would appreciate if I could force Ant to process ALL target even it seems NOT to
be necessary.
How can I achieve this from within Ant script?
Is there a flag like
forceprocessing="Yes"
Ben
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: How to force Ant to perform all targets even when not necessary?
Posted by Ja...@rzf.fin-nrw.de.
>> 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
Maybe there is also a confusion. Are you shure that the "targets" are
not executed or are the "tasks" not executed? E.g.
<target name="compile">
<javac .../>
</target>
<target name="build" depends="compile"/>
$ant build
$ant build (a 2nd time)
On the second time the 'compile' target will be executed while 'javac'
wont do anything because there are no newer source files.
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: How to force Ant to perform all targets even when not necessary?
Posted by Dominique Devienne <dd...@gmail.com>.
On Sat, Jan 24, 2009 at 4:52 AM, Ben Stover <bx...@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