ANT Tutorial

Specifying meaningful descriptions

The build file we saw in the previous section is nice and concise, but it doesn't say much about the actual project being built. There are a number of ways to make it more descriptive without changing the functionality. Here's an example:

<?xml version="1.0"?>
<project default="init" name="Project Sample">
	<description>
		A simple project introducing the use of descriptive tags in Ant build files.
	</description>
	<!-- XML comments can also be used -->
	<target name="init" description="Initialize database connectivity">
		<!-- perform initialization steps here -->
	</target>
</project>
As you can see, XML comments can be used throughout build files to improve clarity. Also, Ant defines its own description element and description attribute, which can be used to provide more structured annotations.