i do the same all the time, except i prefix the property name w/ the
function name.  
there isn't an alternative in nant at present.  
for my money, if there were, i'd prefer the following syntax:

<call name="function >
        <property name="foo" value="bar" />
        <property name="momo" value="lala" />
</call>

with a mechanism to keep the param properties local to the "function"
(i.e. don't collide w/ the global property namespace).

but it's all moot at this point...

jean


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Daniel Bron
> Sent: Monday, December 15, 2003 11:18
> To: Nant (E-mail)
> Subject: [Nant-users] Call a target like a function?
> 
> 
> Hello,
> 
> I have a type of target I call a lot.  Every time I write 
> this type of target, the only difference from the last time 
> is in some "parameters".  I'm wondering if there's any way to 
> write a "template target" and call it like a function (i.e. 
> parameterize it).
> 
> I figure I could do this like:
> 
>       <target name="function">
>               <echo message="${global.property.foo}" />
>       </target>
> 
>       <property name="global.property.foo" value="A">
>       <call target="function" force="yes">
> 
>       <property name="global.property.foo" value="B">
>       <call target="function" force="yes">
> 
> but I'd prefer something like 
> 
>       <target name="function">
>               <echo message="${my.parameters.foo}" />
>       </target>
>       
>       <call target="function" parameters="foo=A" />
>       <call target="function" parameters="foo=B" />
> 
> This is clearer and easier to maintain.  Does Nant have any 
> mechanism like this?
> 
> -D. Bron
> 
> 
> 
> -------------------------------------------------------
> 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/n> ant-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