Yeah, I found what was doing that. The Element class was writing values
back into the XmlDocument Nodes. I have fixed this. I've also checking
in the version of Target.cs with a protected copy constructor, typed
Copy method and ICloneable.Clone support. To support this completely I
needed to support Copy on the base class of Target, Element.

With these changes you can easily do the following from a task:
Project.Targets.Find("namehere").Copy().Execute();

I've mocked up a version of the CallTask that has a "force" attribute.
If set to true, this creates a new copy of the target, and executes it
during Execute on the call.

What do you think of changing Call to allow you to re-execute a target?
The default behavior would not change.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Browning, Don
Sent: Friday, May 17, 2002 11:25 AM
To: 'NAnt Developers'
Cc: 'Brad Wilson'
Subject: RE: [nant-dev] Possible bug calling the same target more than
once

That sounds like a great idea.  Actually I made a change similar to that
earlier today and the everything worked fine... Except.....
It seems there is an issue with referencing properties inside the called
target.  The first time you call a target and you reference an existing
property, you get the value the property is set to.  If you then change
the value of the property and recall the target, the called target has
the original property value, not the newly changed value.
I didn't make the exact change you are (I didn't change the copy
constructor, I removed the check for _hasExecuted from the Execute()
method of the Target class), so hopefully your change will propagate the
property changes correctly.
Below is the sample code I tested with earlier.  In this sample code,
the value of the myProp property only returns a value of 2 when echoed
immediately after the reassignment.
Thanks all... 
Don 
 


_______________________________________________________________

Hundreds of nodes, one monster rendering program.
Now that’s a super model! Visit http://clustering.foundries.sf.net/
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to