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: Ant: pros and cons!
Date Mon, 19 Jul 2004 13:41:53 GMT
Robert Mark Bram wrote:
> Hi All,
> 
> I am writing an intro for ANT and I want to justify why it is such a  
> useful tool.
> 
> Some may find the statements below provocative: they are meant to be. I  
> want to find out if and/or why they are untrue. This is a learning 
> process  for me too!
> 
> Pro:
>  - Ant is a Java based build tool. Like java, it is platform independent.

Ant allows you to construct platform independent build files and 
provides a lot of tasks for common operations. However an Ant script is 
not guaranteed to be platform independent. You can easily exec platform 
specific commands and some task sets may only work on specific platforms.

>  - It has a large variety of common tasks already catered for.
>  - It is extensible: not that hard to create your own tasks.
> 
> Cons:
>  - It is not as powerful as batch/shell scripts. If you are not 
> regularly  using different OS's, why bother?

That is not really true. Ant gives your build process structure and 
repeatability. Setting up targets for the large scale operations and 
then linking those with the depends attribute helps to describe the 
structure of your build process. Yes, you need to compile before you 
create the jar. This is not so easy in batch files.

Ant tasks embody a lot of code. To reproduce that sort of processing in 
a batch file would require a large batch file. Batch files for a large 
build are going to be very complex and not really standardized. So new 
people coming into a team are going to have a hard time understanding 
what is going on. IMHO, Ant scripts are easier to understand and 
hopefully all of the developers on a team, old and new, can grasp what 
the build does and how it does it. Having just one overworked build guy 
understand it all isn't great when he or she decides to move on.

>  - It is not designed to offer decision or looping structures as easily 
> as  they are offered in batch/shell scripts? Why?

The idea is to move that sort of processing into tasks where it is more 
easily handled. Sort of an encouragement to do the job with the right 
tool. Coding decisions and loops in Java is easier than doing it in XML.

Ant's core does support these sort of tasks, however, if you really need 
them - check out ant-contrib or antelope for some looping style tasks. 
Part of the extensibility capabilities.

Conor

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


Mime
View raw message