Re: [nant-dev] Suggestion for call element
Bruce Leggett wrote: 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 This has been discussed previously, and I personally like the idea. It was (rightly) looked at as something that should be fully explored and done properly if/when it's done... but I forget where the discussion was left. As a comment on the above, I'd suggest being able to specify parameters as read/write so the calling target will be able to pick up any changes made to the parameter by the called target, instead of using returns: call target=build call-parameters parameter name=solution value=MySolution.sln / parameter name=result property=BuildResult / /call-parameters /call fail unless=${BuildResult == 'success'}No good!/fail [...] target name=build expected-parameters parameter name=solution required=true / parameter name=result return=true / /expected-parameters do-stuff with=${solution} / property name=result value=success / /target Regards, -- Troy PS- If your target is in another build file, then the nant task can be used, which already supports calling a target with extra properties! --- 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
[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 BEGIN:VCARD VERSION:2.1 N:Leggett;Bruce FN:Bruce Leggett ORG:Advanced System Technologies TITLE:Software Engineer TEL;WORK;VOICE:850-475-4006 ADR;WORK:;;;Pensacola;FL LABEL;WORK:Pensacola, FL EMAIL;PREF;INTERNET:[EMAIL PROTECTED] REV:20040730T225912Z END:VCARD
RE: [nant-dev] Suggestion for call element
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
RE: [nant-dev] Suggestion for call element
-Original Message- From: Gary Feldman [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 24, 2004 11:50 AM To: Castro, Edwin Gabriel (Firing Systems Engr.); Bruce Leggett; Nant- Developer List Subject: Re: [nant-dev] Suggestion for call element From: Castro, Edwin Gabriel (Firing Systems Engr.) [EMAIL PROTECTED] Sent: Wednesday, November 24, 2004 1:53 PM 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 ... 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! It's easily done in make with recursive calls to make, but that's because make originated on platforms with dirt cheap process forks. The other common mechanism is to write your own pattern rules - but the abstruse nature of pattern rules is part of the reason people are moving away from make. Gary Yeah, but I need the ability to pass parameters to my pattern rules. I can't figure out how I would do that. Like wise, I might be able to recursively run make passing some arguments in the command line (assuming that's possible) but again, I don't know how to do that either! My point is that I can't think of a way to do what I need to do. In the end I kept my bash script because I could do what I needed to do although I had to build significant infrastructure to mimic make or nant targets. --Edwin --- 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
Re: [nant-dev] Suggestion for call element
From: Castro, Edwin Gabriel (Firing Systems Engr.) [EMAIL PROTECTED] Sent: Wednesday, November 24, 2004 1:53 PM 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 ... 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! It's easily done in make with recursive calls to make, but that's because make originated on platforms with dirt cheap process forks. The other common mechanism is to write your own pattern rules - but the abstruse nature of pattern rules is part of the reason people are moving away from make. Gary --- 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