----- Original Message -----
From: "Jean Rajotte" <[EMAIL PROTECTED]>
To: "'Breen, Patrick'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, November 20, 2003 3:54 PM
Subject: RE: [Nant-users] Incorrect dependency evaluation?


> please let it be that 0.8.4 behaviour is a bug, and that <0.8.4
> behaviour is the right one.  there's a force= attribute to change that.
> i'm heavily invested in only-run-once for depends=  (e.g. every target
> calls the global init-props target to afford each target granularity).
>

The change that was done in NAnt 0.8.4 is actually a large improvement, as
you can now have dependent targets executed again by using the <call> task.
This was not possible in previous versions of NAnt.

This is very useful if you, for example, want to build an assembly and its
doc twice in the same build : once in the debug configuration and once for
the release configuration.  This can now be achieve using :

<target name="clean" />
<target name="build-assembly" />
<target name="build-docs" />
<target name="debug" depends="clean, build-assembly, build-docs" />
<target name="release" depends="clean, build-assembly, build-docs" />

<target name="build">
    <call target="debug" />
    <call target="release" />
</target>

In earlier versions of NAnt, you could not achieve such a thing as the
clean, build-assembly and build-docs targets would not be executed again
when you'd call the "release" target (with or without the force attribute
set to "true").  In previous versions of NAnt you would have to call each
individual target manually using the <call> task (with force set to "true"),
thereby you would not longer be able to use the depends attribute for
defining target dependencies for the second time you'd want to execute a
target and its dependencies ...

The new behaviour also matches the behaviour of Ant.

If you only want to execute targets once, you should use the depends
attribute.  Explicitly calling a specific target will, from now on, cause
the given target and its dependencies to be executed again.

Hope this explains our motives ...

Gert

>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of
> > Breen, Patrick
> > Sent: Thursday, November 20, 2003 09:47
> > To: [EMAIL PROTECTED]
> > Subject: [Nant-users] Incorrect dependency evaluation?
> >
> >
> > In version 0.8.4 when a target is defined with a dependency
> > that calls another target with the same dependency, the
> > target is executed a second time. In version 0.8.3, the
> > target was only executed once.  Which is the proper / desired
> > behavior?  The build scripts we have were counting on the
> > 0.8.3 behavior, but its simple enough to add a property that
> > prevents the second execution if the new behavior is the
> > correct implementation.
> >
> > Here's an example.  The target "common-target" is executed
> > twice in this example.
> >
> > BUILDFILES:
> >
> > <?xml version="1.0"?>
> > <project name="Test" default="buildall" basedir=".">
> >
> > <target name="buildall" depends="common-target">
> > <echo message="buildall evaluated" />
> > <call target="build" />
> > </target>
> >
> > <target name="common-target">
> > <echo message="common-target evaluated" />
> > </target>
> >
> > <target name="build" depends="common-target">
> > <echo message="build evaluated" />
> > </target>
> >
> > </project>
> >
> > OUTPUT:
> >
> > NAnt version 0.8.4 Copyright (C) 2001-2003 Gerry Shaw
> http://nant.sourceforge.net
>
> Buildfile: file:///C:/test.build
> Target(s) specified: buildall
>
> common-target:
>
>      [echo] common-target evaluated
>
> buildall:
>
>      [echo] buildall evaluated
>
> common-target:
>
>      [echo] common-target evaluated
>
> build:
>
>      [echo] build evaluated
>
> BUILD SUCCEEDED
>
> Total time: 0.2 seconds.
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program. Does
> SourceForge.net help you be more productive?  Does it help you create
> better code?  SHARE THE LOVE, and help us help YOU!  Click Here:
> http://sourceforge.net/donate/
> _______________________________________________
> Nant-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?  SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Nant-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
>



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to