I will try to put together a proposal in the next couple of days.

 

The following is subject to memory fade as I looked at it a few years
ago and started to explore a solution.

 

I had considered extending the property system to include a form of
scoping. Limiting visibility of a parameter or other locally scoped
property to only the task where it is defined would be extremely
difficult. I think I rejected this.

 

Possibly the simplest solution is something like the following:

1.     Call task starts.

2.     Save the values of parameters that already exist as properties
and note which parameters do not exist. (CALL context)

3.     Set/create property entries for the parameters listed under the
CALL

4.     Enter the designated target passing CALL context.

5.     The Parameter task checks if the name is present in the CALL
context. If missing and there is a default value, save any existing
value to the CALL context and set it to the default value.

6.     If property has "Local=yes", save previous value in LOCAL context
and set value.

7.     When target exits, any properties in local context are restored
to previous state (if local property did not exist, delete it). DO THIS
EVEN for an exception

8.     Return to Call.

9.     Restore properties in CALL context to original state (prior value
or remove if they didn't exist) DO THIS EVEN for an exception

10.  Every thing is back to normal.

 

 

From: Bob Archer [mailto:bob.arc...@amsi.com] 
Sent: Wednesday, May 13, 2009 2:36 PM
To: Gert Driesen; Bjerstedt, Tony [Audatex - Americas]; 'Parrish, Ken';
nant-users@lists.sourceforge.net
Subject: RE: [NAnt-users] <call> task with parameters ...

 

Would it be better to create a function or a task that you can pass
stuff to, rather than having to worry about property scoping?

 

BOb

 

 

________________________________

From: Gert Driesen [mailto:gert.drie...@telenet.be] 
Sent: Wednesday, May 13, 2009 3:04 PM
To: 'Bjerstedt, Tony [Audatex - Americas]'; 'Parrish, Ken';
nant-users@lists.sourceforge.net
Subject: Re: [NAnt-users] <call> task with parameters ...

 

Hi Ken, Tony,

 

This is definitely something that I've considered as well.

Can one of you work out a proposal that can be discussed on the list?

 

Gert

 

From: Bjerstedt, Tony [Audatex - Americas]
[mailto:tony.bjerst...@audatex.com] 
Sent: woensdag 13 mei 2009 20:01
To: Parrish, Ken; nant-users@lists.sourceforge.net
Subject: Re: [NAnt-users] <call> task with parameters ...

 

I have wondered the same thing. If this were added, I would suggest an
approach similar to XSLT.

 

An XSLT like approach would look something like:

 

            <call target="name">

              <with-parameter name="param1" value="..."/>

              <with-parameter name="param2" value="..."/>

               ...

            </call>

 

and 

            <target name="name">

              <parameter name="param1" default="value"/>

              <parameter name="param2" />

              ...

            </target>           

 

A couple of years ago I started playing with this type of approach.

 

 

From: Parrish, Ken [mailto:kparr...@gomez.com] 
Sent: Wednesday, May 13, 2009 10:56 AM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] <call> task with parameters ...

 

Has there ever been any consideration to creating a mechanism for
executing the <call> task with a set of private, local parameters
(properties) which are only available inside the called task?

 

I'm not sure exactly how the syntax would work, but the idea would be to
pass, as an argument to the <call> task, a list of name/value pairs, or
a list of values that are identified by place or order.

 

I find the I often need to fabricate some sort of parameter passing
mechanism, using globally defined <properties> , to control <task>s that
are designed to be general purpose.  Typically, I'll create <property>
elements that have names which include the name of the task:

 

                <property name="mytask_sourceDir" value="sourceValue" />

                <call task="mytask" />

 

I'd much prefer something like:

 

                <call task="mytask" parameters="sourceDir=sourceValue"
/>

 

The assumption would be that the parameter 'sourceDir' is visible only
inside 'mytask'.

 

Thoughts, ideas, considerations?

 

Ken Parrish

Gomez, Inc.

 

 


-
------------------------------------------------------------------------
---



PRIVILEGE AND CONFIDENTIALITY NOTICE
The information in this electronic mail (and any associated attachments)
is intended for the named recipient(s) only and may contain privileged
and confidential information. If you have received this message in
error, you are hereby notified that any use, disclosure, copying or
alteration of this message is strictly prohibited. If you are not the
intended recipient(s), please contact the sender by reply email and
destroy all copies of the original message. Thank you.



-
------------------------------------------------------------------------
--

Internal Virus Database is out of date.
Checked by AVG - www.avg.com
Version: 8.5.285 / Virus Database: 270.12.2/2072 - Release Date:
04/21/09 16:48:00


- ---------------------------------------------------------------------------

 

PRIVILEGE AND CONFIDENTIALITY NOTICE
The information in this electronic mail (and any associated attachments) is 
intended for the named recipient(s) only and may contain privileged and 
confidential information. If you have received this message in error, you are 
hereby notified that any use, disclosure, copying or alteration of this message 
is strictly prohibited.  If you are not the intended recipient(s), please 
contact the sender by reply email and destroy all copies of the original 
message.  Thank you.

 

- --------------------------------------------------------------------------
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to