Ian:
I forgot to comment on your second paragraph (on ExternalProgramBase).
I looked at ExternalProgramBase but opted to not use it. It would be more consistent to derive from it, but there were a few things in ExternalProgramBase that I didn't like.
The API seemed more geared towards the <exec> task and less towards a task that cleanly encapsulates the output of a specific tool. For example, it doesn't make sense for the user to be able to modify the arguments. The value in writing a specific task for performing an update is an elegant interface. If the user wanted to pass any old arguments they should just use <exec>.
Also, many tools (including ClearCase) return nonzero exit status codes even though the operation succeeded. This isn't the case with cleartool's update command but is for several other commands. The base needs the ability to selectively ignore nonzero exit codes.
Finally, another (admittedly small) quirk was that references to standard output and standard error streams were stored in a Hashtable, even though there is always exactly two streams. They should be two members of type StreamReader.
The CruiseControl .NET project is wrestling with the same issues. We've a similar base class called ProcessSourceControl (http://cvs.sourceforge.net/viewcvs.py/ccnet/ccnet/project/core/sourcecontrol/ProcessSourceControl.cs) which we've had to modify several times to accommodate different source control systems.
Best,
Garrett
Ian MacLean <[EMAIL PROTECTED]>
05/14/2004 11:18 PM |
To: Garrett Smith <[EMAIL PROTECTED]> cc: [EMAIL PROTECTED] Subject: Re: [NAntC-Dev] ClearCase support submitted |
Thanks Garret,
We've also just received another clear case task - on the same day- one
that uses the automation library and can run any clearcase command. See
my recent post where I forwarded the code to the list. I don't run clear
case but add the moment I'd lean towards adding the automation based
version. Would you mind looking at the alternative implementation and
let me know if it is feature compatible with your s ?
As a heads up - when developing a nant task that wraps an executable its
easier and more consistent to derive your task from ExternalProgramBase.
This base class handles all the mechanics of calling the process and
gathering its output and error streams - saving you from having to
duplicate it.
Ian
Garrett Smith wrote:
>I've submitted a patch (#953622) that provides the ability to update
>source via ClearCase. Send me a message if you have any questions.
>
>Best,
>Garrett
>
>
--
Ian MacLean, Developer,
ActiveState, a division of Sophos
http://www.ActiveState.com