I think the macro-def task looks like a much nicer syntax, and it would be
nice to mirror Ant if it has the same thing already.
(Wish I'd noticed this when I wrote NAntScript)
From: Richard Brown (GMail)
Sent: Thursday, May 14, 2009 1:25 PM
To: Bjerstedt, Tony [Audatex - Americas] ; Bob Archer ; Gert Driesen ; Parrish,
Ken ; nant-users@lists.sourceforge.net
Subject: Re: [NAnt-users] <call> task with parameters ...
Hi all,
I think this would be a great addition to the core functionality of NAnt.
I had previously done something similar, but it was a bit hacky:
http://nant.sourceforge.net/external.html#nantscript
Most of the hacks revolved around the ability to not just pass in regular
parameters, but also complete sections of custom XML. I'm not sure it there's
a nice way to do this (and it tends to make the schema checking of NAnt screw
up), but it would be excellent if it could be handled in a more elegant way by
the core engine.
e.g., In addition to the ability to call a target like:
<call target="name">
<with-parameter name="param1" value="."/>
<with-parameter name="param2" value="."/>
.
</call>
... you might want to call a target with a complex parameter type like:
<call target="name">
<with-parameter name="param1">
<include name="*.myFiles"/>
<exclude name="*.notMyFiles"/>
<with-parameter/>
<with-parameter name="param2">
<include name="*.myResourceFiles"/>
<with-parameter/>
.
</call>
Regards,
Richard
From: Duncan Godwin
Sent: Thursday, May 14, 2009 9:45 PM
To: Bjerstedt, Tony [Audatex - Americas] ; Parrish, Ken ;
nant-users@lists.sourceforge.net
Subject: Re: [NAnt-users] <call> task with parameters ...
Hi
I came across this task a while ago and looks like a good fit though I haven't
tried it myself:
http://www.markhneedham.com/blog/2008/08/14/macros-in-nant/
Cheers
Duncan
----- Original Message -----
From: Bjerstedt, Tony [Audatex - Americas]
To: Parrish, Ken ; nant-users@lists.sourceforge.net
Sent: Wednesday, May 13, 2009 7:00 PM
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.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users