You know, I was just trying to do something similar to this... I was
writing a bash script to automate compilations of a few projects and I
had similar sections I could wrap up into functions and call them later.
Anyway, I thought to myself I should be able to define a few top level
targets using make and do the same thing as the bash script. Well, I
couldn't figure out how to mimic functions in make (pass parameters to
common code) so I gave up. I never thought of using NAnt (since for the
most part I would need to use <exec> to call other builders) but if I
can mimic functions using targets or something else that would be great!

In the past I have simply created parameters that would get used by the
called target but that can be error prone! A function target type would
be really useful to those people that are trying to factor out common
code!

--Edwin

> -----Original Message-----
> From: [EMAIL PROTECTED]
[mailto:nant-developers-
> [EMAIL PROTECTED] On Behalf Of Bruce Leggett
> Sent: Wednesday, November 24, 2004 7:47 AM
> To: Nant-Developer List
> Subject: [nant-dev] Suggestion for call element
> 
> It would be nice if call target could accept parameters. Also if you
could
> specify a file the target is located in then there would be increased
> encapsulation. Then code would be easier to maintain. Also if the
target
> could return a value. If there is something like this already then let
me
> know.
> 
> Example:
> <property name="BuildReturnValue" />
> <call target="build" fromfile="BuildTarget.build"
> return="BuildReturnValue">
>       <parameter name="strSolutionFile" value="MySolution.sln">
> </call>
> 
> <ifnot test=${BuildReturnValue= 'true'}>
>       ...
> </ifnot>
> 
> BuildTarget.build file contents:
> <!-- maybe not have the project for root element? -->
> <target name="build">
>       <parameter name="strSolutionFile" />
>       <solution configuration="debug"
solutionfile="${strSolutionFile}"/>
>       <return value="true"/>
> </target>
> 
> I haven't gave this much thought but I think you will get the idea.
Maybe
> make a function target? Anyways I just want to get somebodies wheels
> turning.
> 
> Thanks,
> Bruce Leggett
> Software Engineer
> Advanced Systems Technology, Inc.
> 850.475.4006


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to