Summary

This chapter demonstrated how to extend Ant by adding a custom task. The custom task was extended to include a built-in data type. When we discovered that the built-in data types didn’t quite fit, we introduced a custom data type. In the process of adding a custom task, we were able to extend Ant functionally. While adding a custom DataType, we were able to increase Ant’s usability and readability. When that was completed, we added reference support for our custom data type, DirectorySet. The final section of this chapter described how to build and deploy a custom listener.

  • Tasks may be executed many times, but initialized only once.

  • Custom tasks should extend the class org.apache.tools.ant.Task.

  • Custom tasks must provide a public set() ...

Get Ant Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.