Chapter 27. Best Practices

Table of Contents

27.1. Guidelines for Extension Authors
27.2. Guidelines for Make Rule Authors
27.3. Guidelines for Ant Target Authors
27.4. Hidden Dependencies
27.5. Interfaces and Implementations

This chapter describes some “best practices” that should be kept in mind while using abuild. It is based on experience using abuild and lessons learned from that experience.

27.1. Guidelines for Extension Authors

If you are writing code to extent abuild through plugins, hook build items, or build item rules, there are several things you should keep in mind. This section describes items that pertain to both make and ant extensions.

  • If your rules or plugin adds support for an optional tool, you must consider carefully what you will do if that tool is not available. One option would be to fail. Another option would be to simply not provide the added functionality. For example, if you are providing a plugin that adds support for a new compiler, your plugin should detect whether the compiler is available, and if it is not, it should avoid listing it as an available compiler or platform. This makes it possible for people to continue to build with other compilers on systems that lack your additional one.

  • Since your clean target is not run when abuild is invoked normally, please avoid having rules create files outside of the output directory from which they are run. Any such products will not be removed by abuild clean as run by ordinary users even if you have coded removal of those products in your own clean target.