You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

intro.html 2.9 KiB

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