The <call/> task executes the target and all dependencies (whether they have
executed already or not, and only once).
Maybe to get the correct behavior we need to add a forcedepends attribute to
control the execution of the dependencies. It seems strange to introduce a
<depends/> task when it is really just a special behavior (non-default) of
<call/>.
I'd be more than happy to take a contribution to NAntContrib for the
<depends /> task if you want to contribute. We can move it to NAnt if people
want it and it tests out well :) All the code you need is in
Project.Execute("targetname", boolForceDep).
The more you want to contribute, the better the project will be :)
----- Original Message -----
From: "James C. Papp" <[EMAIL PROTECTED]>
Sent: Thursday, January 01, 2004 2:15 AM
> Well, reintroducing the "force" attribute seems like a bad idea since it
has
> already been deprecated (but thanks for asking); its resurrection would
> probably just cause too much confusion.
>
> Your solution:
>
> <call target="foo" unless="target::has-executed('foo')/>
>
> (BTW, all the new expression evaluation and function support is awesome.
With
> these new capabilities I can finally remove a bunch of custom C#
> script-functions in our NAnt build files. Though, the fact that we could
do
> something as shown above is just too cool...)
>
> Anyway, back to your solution. This may work, but it all depends on how
the
> "call" task handles dependencies; here's an example:
>
> <target name="A" depends="B, C"/>
> <target name="B" depends="D, F"/>
> <target name="C" depends="D, E"/>
> <target name="D"/>
> <target name="E" />
> <target name="F" />
>
> Let's say that task "A" is triggered (via a "call" task, or something
equivalent
> like the proposed "depends" tasks). There are five possible ways things
can
> occur (unfortunately):
>
> 1. Task "A" executes regardless if it executed before and dependencies
are
> ignored.
> = A
>
> 2. Task "A" executes but only if it has not so far; dependencies are
ignored.
> = (A)
>
> 3. Task "A" executes regardless if it executed before and all its
dependencies
> are force to execute as well (even duplicates)
> = D, F, B, D, E, C, A
>
> 4. Task "A" executes regardless if it executed before as well as all its
> dependencies but duplicates are prevented from executing more then once.
> = D, F, B, E, C, A
>
> 5. Task "A" executed only if it has not executed before as well as its
> dependencies
> = (D), (F), (B), (D), (E), (C), (A) which is identical to (D), (F), (B),
(E),
> (C), (A) by the virtue that a target is only ever executed once.
>
> * Note: Targets in parentheses only get executed if the have not executed
> already; targets listed without parentheses are always forced to execute.
>
> For our builds we need number 5 to work and the proposed "depends" task
would do
> just that and hopefully with less confusion since its name implies this
sort of
> thing. Now my understanding of the "call" task is that it would do 3, but
it
> may do 4, not sure as the documentation is a little ambiguous here. So, I
> don't think your solution would work unless we had a very simple
dependency
> tree which we don't.
>
> However, if you like the idea of the proposed "depends" task I will
volunteer to
> do all the work that is needed (or that you want me to do). We use NAnt
so
> much I feel obliged to contribute; we also have a goal to be able to use
an
> unmodified version. With the latest release we are almost there; changes
to
> the "exec" task (see top of thread) and an "options" attribute for the
"csc"
> task are still needed.
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers