Ant Tutorial «Prev  Next»


Ant tasks

The following tables provide a short description of each task.
  1. Archive Tasks (Jar, Ear, Tar, War, GZip, Zip etc.)
  2. Audit/Coverage Tasks (JDepend, JPorbe, MMetrics, etc. )
  3. Compile Tasks (javac, jspc, rmic etc.)
  4. Deployment Tasks (ServerDeploy)
  5. Documentation Tasks (Javadoc, Stylebook)
  6. EJB Tasks
  7. Execution Tasks (Ant, Antcall, Exec, Java, Sleep etc.)
  8. File Tasks (Attrib, Copy, Copydir, delete, Mkdir etc.)
  9. Java2 Extensions Tasks (Jarlib-available, Jarlib-display etc.)
  10. Logging Tasks (Record)
  11. Mail Tasks (Mail, MimeMail)
  12. Miscellaneous Tasks (Echo, GenKey, Script, Sqletc.)
  13. .NET Tasks
  14. Pre-process Tasks (ANTLR, AntStructure, Import, Xslt/Style etc.)
  15. Property Tasks (Available, Basename, BuildNumber, LoadFile etc.)
  16. Remote Tasks (FTP, Telnet etc. )
  17. SCM Tasks (Cvs, CvsChangeLog, CVSPass etc.)
  18. Testing Tasks (Junit, JunitReport, Test)
  19. Visual Age for Java Tasks

User-Written Tasks

The concept of extending Ant through customization has been and still is its most important and acclaimed feature. The creators of Ant provide us with a system robust enough to work with the languages and tools available today and the ability to grow and work with the languages and tools of tomorrow. For example, tasks exist for working with the C# language, which did not exist when Ant first appeared in early 2000. Users have written tasks for working with third-party tools from groupware products, such as StarTeam (a version control system), to application servers such as BEA's WebLogic or the JBoss Group's JBoss. These changes and improvements came about with little or no changes to Ant's core processing engine. Extending Ant without modifying its core engine is very important because it means the core Ant engine can be improved and modified separately from extension development. Development in both areas is done concurrently, resulting in modifications being made faster than had Ant been a monolithic system.

Ant tasks are Java Classes

All Ant tasks are Java classes, and any programmer can extend the functionality of Ant by writing a new Java task class. These are user-written tasks, and take advantage of the same interface to Ant used by the core tasks shipped with an Ant distribution. The only differences between a user-written task and a core task are the author and the package location of the task (and sometimes that's the same!). Otherwise, they both function on the same level playing field. In this chapter, we'll show you how to extend Ant by writing your own tasks.