1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>Apache Ant User Manual - Introduction</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 | <h1><a name="introduction">Introduction</a></h1>
|
---|
11 | <p>Apache Ant is a Java-based build tool. In theory, it is kind of like
|
---|
12 | <i>make</i>, without <i>make</i>'s wrinkles.</p>
|
---|
13 | <h3>Why?</h3>
|
---|
14 | <p>Why another build tool when there is already
|
---|
15 | <i>make</i>,
|
---|
16 | <i>gnumake</i>,
|
---|
17 | <i>nmake</i>,
|
---|
18 | <i>jam</i>,
|
---|
19 | and
|
---|
20 | others? Because all those tools have limitations that Ant's original author
|
---|
21 | couldn't live with when developing software across multiple platforms.
|
---|
22 | Make-like
|
---|
23 | tools are inherently shell-based: they evaluate a set of dependencies,
|
---|
24 | then execute commands not unlike what you would issue on a shell.
|
---|
25 | This means that you
|
---|
26 | can easily extend these tools by using or writing any program for the OS that
|
---|
27 | you are working on; however, this also means that you limit yourself to the OS,
|
---|
28 | or at least the OS type, such as Unix, that you are working on.</p>
|
---|
29 | <p>Makefiles are inherently evil as well. Anybody who has worked on them for any
|
---|
30 | time has run into the dreaded tab problem. "Is my command not executing
|
---|
31 | because I have a space in front of my tab?!!" said the original author of
|
---|
32 | Ant way too many times. Tools like Jam took care of this to a great degree, but
|
---|
33 | still have yet another format to use and remember.</p>
|
---|
34 | <p>Ant is different. Instead of a model where it is extended with shell-based
|
---|
35 | commands, Ant is extended using Java classes. Instead of writing shell commands,
|
---|
36 | the configuration files are XML-based, calling out a target tree where various
|
---|
37 | tasks get executed. Each task is run by an object that implements a particular
|
---|
38 | Task interface.</p>
|
---|
39 | <p>Granted, this removes some of the expressive power that is inherent in being
|
---|
40 | able to construct a shell command such as
|
---|
41 | <nobr><code>`find . -name foo -exec rm {}`</code></nobr>, but it
|
---|
42 | gives you the ability to be cross-platform - to work anywhere and
|
---|
43 | everywhere. And
|
---|
44 | hey, if you really need to execute a shell command, Ant has an
|
---|
45 | <code><exec></code> task that
|
---|
46 | allows different commands to be executed based on the OS it is executing
|
---|
47 | on.</p>
|
---|
48 |
|
---|
49 | <hr>
|
---|
50 | <p align="center">Copyright © 2000-2002,2004 The Apache Software Foundation. All rights
|
---|
51 | Reserved.</p>
|
---|
52 |
|
---|
53 | </body>
|
---|
54 | </html>
|
---|
55 |
|
---|