Creating a Custom Ant Task

See Also 

You can create Ant tasks to use in your build scripts. An easy way to start is by using the Custom Task template provided by the IDE.

To use the template:

  1. Choose File and choose New from the main window.
  2. Expand the Ant Build Scripts node and select Custom Task. Click Next to proceed.
  3. Provide a class name and package in the Name and Package text fields.
  4. Click Finish.

The custom task file is displayed in the Source Editor. The template includes the basic skeleton code for your class and sample business logic for typical tasks.

You can use the Ant Documentation module to view Javadoc documentation for Ant classes related to writing custom tasks and to enable code completion for these classes. The module also integrates the Ant manual with the IDE.

tip You may need to mount ant-1.5.1.jar in the IDE's Filesystems tab to compile and use some custom tasks. The Ant JAR is in the modules/ext/ directory of your IDE's installation directory.

Custom Tasks and the Explorer View

If you define custom tasks and then run a project using them at least once, the Ant module recognizes their XML structure and enables you to edit them in the Explorer just like standard tasks. The same applies to custom data types.

For more information on writing Ant tasks, see Using Ant in the Ant 1.5.1 Manual.

See Also
Ant Classpath and Custom Ant Tasks
Optional Ant Tasks
Installing Ant Documentation

Legal Notices