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.3 KiB

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