ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stephan beal <>
Subject Re: Cvs <commandline> implementation question...
Date Sat, 23 Mar 2002 15:41:59 GMT
On Saturday 23 March 2002 14:49, Erik Hatcher wrote:
> -1 to both approaches, as they both just seem unnecessary.  Why not just
> use the Commandline/Environment/Execute classes that AbstractCvsTask
> currently uses in its execute() method?  There are several Ant tasks that
> execute command-line utilities in this manner and we should stick with that
> pattern.

i don't agree. The problem is that ExecTask has a lot of code to handle the 
actually running of the command, and i *really* hate duplicating any code 
longer than about one line long. Without either subclassing or opening up the 
API i've gotta duplicate a lot of code, which adds to maintenance.

> It seems with a little refactoring of AbstractCvsTask ("extract method"
> refactoring on stuff in execute() for example) that you'd accomplish what
> you need by reusing the existing execute code there.

i'd still have to duplicate code from ExecTask if i want to implement the 
command line args in a way which is consistent with the other objects. Go 
look at ExecTask and you'll see that the thing has practically only protected 
methods. If they are made public then this object can be used as a generic 
proxy for running any external commands. Seems silly to re-implement that 
behaviour somewhere else.

-----  - -
"All them women gonna make me teach 'em what they don't know how. 
I'm going to Jackson." -- Johnny Cash

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message