ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: exec command deprecated since Ant 1.2 but recommended in Ant 1.5?
Date Sun, 25 Aug 2002 01:26:03 GMT
Amar Rama wrote:
> Hi,
>    I am looking for some answers around the usage of the  <exec> command 
> and would be grateful for any assistance :-).

The <exec> task is not deprecated
The Exec class is deprecated
<exec> is no longer implemented by the Exec class but is now implemented by 
ExecTask

> 
> According to the javadoc in the source code of the exec command 
> (reproduced below), this command has been deprecated since Ant 1.2 and 
> the use of the Execute command is suggested instead.

True.

> 
>    The execute command though just extends java.lang.Object and not 
> org.apache.tools.ant.Task. 

Execute is not a task. It is "service" provided by Ant's core for tasks that 
wish to execute external commands. ExecTask is one such task.

> So, I am not sure I follow how I should use 
> it in my build.xml 

You don't.

> (preliminary searches did not yield any results). I 
> tried using the exec command and it works but I need to extend it to add 
> minor custom functionality and I rather not extend a deprecated class.

Look at ExecTask.


> 
>    The FAQ on the home page for "How do I execute a batch file or shell 
> script from ant?" 
> (http://jakarta.apache.org/ant/faq.html#batch-shell-execute) still 
> recommends using the <exec> command. 


This is correct.

> Since this is the most recent FAQ, 
> I am interpreting this as meaning, use the exec command for Ant 1.5. 
> This seems slightly contradictory to the comment in the code.
> 
>    Can anybody suggest the right direction to take.
> 

You have made an assumption (<exec> == Exec class) which is incorrect.

Conor



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message