Title: RE: [Nant-users] 0.85 Dependency Resolution
Payton,
 
The target::has-executed() only works on a project level, and the <nant> task actually creates a new project on each run.
 
Gert


From: Byrd, Payton [mailto:[EMAIL PROTECTED]
Sent: donderdag 11 november 2004 16:17
To: 'Gert Driesen'
Subject: RE: [Nant-users] 0.85 Dependency Resolution

Would this work between calls to the <nant> task?

If I have the following:

nant1.build:
<project>
      <target name="A" unless="${target::has-executed('A')}" />
      <target name="B" depends="A" unless="${target::has-executed('B')}" />
</project>

default.build:
<project default="A">
        <nant buildfile="nant1.build" target="A" />
        <nant buildfile="nant1.build" target="B" />
      <target name="A" unless="${target::has-executed('A')}" />
</project>


Calling:

nant A

If I'm understanding this correctly, the output should be:

     [nant] D:\nant1.build A
            Buildfile: file:///D:/nant1.build
            Target(s) specified: A


            A:


            BUILD SUCCEEDED

            Total time: 0 seconds.

     [nant] D:\nant1.build B
            Buildfile: file:///D:/nant1.build
            Target(s) specified: B


            B:


            BUILD SUCCEEDED

            Total time: 0 seconds.

BUILD SUCCEEDED


That is not what happens:

Buildfile: file:///D:/default.build
Target(s) specified: A

     [nant] D:\nant1.build A
            Buildfile: file:///D:/nant1.build
            Target(s) specified: A


            A:


            BUILD SUCCEEDED

            Total time: 0 seconds.

     [nant] D:\nant1.build B
            Buildfile: file:///D:/nant1.build
            Target(s) specified: B


            A:


            B:


            BUILD SUCCEEDED

            Total time: 0 seconds.


A:


BUILD SUCCEEDED

Total time: 1.3 seconds.

Is it possible to make the target::has-executed persistent?  I'm sure it could be worked out in a property, but a function seems much more intuitive and doesn't offer an opportunity to introduce an undefined property error.

I realize that if I had done an <include> instead that it would have functioned differently, but that's not always feasible.

Payton Byrd
Trane eBusiness
QED Team
Phone: 931-905-5386
Fax: 931-648-5901

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Gert Driesen
Sent: Thursday, November 11, 2004 8:57 AM
To: 'Whitner, Tom'; [EMAIL PROTECTED]
Subject: RE: [Nant-users] 0.85 Dependency Resolution

Tom,

That is indeed the expected behaviour. If you want to avoid specific targets
from being executed more than once, you could use the
target::has-executed(name) function.
 
        <target name="A" unless="${target::has-executed('A')}" />

        <target name="B" depends="A">
                <call target="C"/>
        </target>

        <target name="C" depends="A" />

I'm not saying this is perfect, but the old behaviour did not allow
dependencies to be re-evaluated at all.

Gert


________________________________

        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Whitner, Tom
        Sent: donderdag 11 november 2004 15:42
        To: [EMAIL PROTECTED]
        Subject: [Nant-users] 0.85 Dependency Resolution
       
       


        With the following targets defined:

                <target name="A" />

                <target name="B" depends="A">
                        <call target="C"/>
                </target>

                <target name="C" depends="A" />

        If I build target B, I get the following results:

        NAnt 0.85 (Build 0.85.1775.0; nightly; 11/10/2004)
        Copyright (C) 2001-2004 Gerry Shaw
        http://nant.sourceforge.net <http://nant.sourceforge.net

        Buildfile: file:///C:/_Commons/Support/Test/test.build
<file:///C:/_Commons/Support/Test/test.build
        Target(s) specified: B

        A:

        B:

        A:

        C:

        BUILD SUCCEEDED

        Please note that target A was built twice.  I believe that in 0.85,
the <call> task has been modified to force the target execution (here target
C).  However, it doesn't make sense that it would force that target's
dependencies (here target A) to be built as well.  I would expect target C's
depends attribute to honor the fact that target A had previously been built.
Is this the expected behavior?

        Thanks,
        Tom




-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to