1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 |
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="stylesheets/style.css">
|
---|
22 | <title>Apache Ant User Manual - Introduction</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 | <h1><a name="introduction">Introduction</a></h1>
|
---|
27 | <p>Apache Ant is a Java-based build tool. In theory, it is kind of like
|
---|
28 | <i>make</i>, without <i>make</i>'s wrinkles.</p>
|
---|
29 | <h3>Why?</h3>
|
---|
30 | <p>Why another build tool when there is already
|
---|
31 | <i>make</i>,
|
---|
32 | <i>gnumake</i>,
|
---|
33 | <i>nmake</i>,
|
---|
34 | <i>jam</i>,
|
---|
35 | and
|
---|
36 | others? Because all those tools have limitations that Ant's original author
|
---|
37 | couldn't live with when developing software across multiple platforms.
|
---|
38 | Make-like
|
---|
39 | tools are inherently shell-based: they evaluate a set of dependencies,
|
---|
40 | then execute commands not unlike what you would issue on a shell.
|
---|
41 | This means that you
|
---|
42 | can easily extend these tools by using or writing any program for the OS that
|
---|
43 | you are working on; however, this also means that you limit yourself to the OS,
|
---|
44 | or at least the OS type, such as Unix, that you are working on.</p>
|
---|
45 | <p>Makefiles are inherently evil as well. Anybody who has worked on them for any
|
---|
46 | time has run into the dreaded tab problem. "Is my command not executing
|
---|
47 | because I have a space in front of my tab?!!" said the original author of
|
---|
48 | Ant way too many times. Tools like Jam took care of this to a great degree, but
|
---|
49 | still have yet another format to use and remember.</p>
|
---|
50 | <p>Ant is different. Instead of a model where it is extended with shell-based
|
---|
51 | commands, Ant is extended using Java classes. Instead of writing shell commands,
|
---|
52 | the configuration files are XML-based, calling out a target tree where various
|
---|
53 | tasks get executed. Each task is run by an object that implements a particular
|
---|
54 | Task interface.</p>
|
---|
55 | <p>Granted, this removes some of the expressive power that is inherent in being
|
---|
56 | able to construct a shell command such as
|
---|
57 | <nobr><code>`find . -name foo -exec rm {}`</code></nobr>, but it
|
---|
58 | gives you the ability to be cross-platform--to work anywhere and
|
---|
59 | everywhere. And
|
---|
60 | hey, if you really need to execute a shell command, Ant has an
|
---|
61 | <code><exec></code> task that
|
---|
62 | allows different commands to be executed based on the OS it is executing
|
---|
63 | on.</p>
|
---|
64 |
|
---|
65 |
|
---|
66 |
|
---|
67 | </body>
|
---|
68 | </html>
|
---|
69 |
|
---|