Creating a Custom Ant Task

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. If you have mounted Javadoc documentation for the Ant API in the Javadoc tab, the Source Editor also provides code completion for the Ant API.
tip

You may need to mount ant-1.4.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.4.1 Manual.

See also
Configuring Ant Settings
Creating and Running an Ant Project

Legal Notices