Skip to end of metadata
Go to start of metadata

An Ant task is provided to compile the annotations.

Usage

First you need to activate the custom task in your Ant build.xml file with the following: (refer to Ant documentation on "taskdef" for more details)

Reference

The AnnotationCTask task accepts the following:

  • verbose: (optional) flag marking the task verbosity (true/false)
  • ignoreUnkown: (optional) flag marking if the task should ignore unknown annotations (like f.e. @author if not associated to an annotation interface) (true / false)
  • properties: (optional) path to a properties file when user-defined annoations are to be used
  • destdir: (optional unless input classes are in more than one path) directory where to put annnotated class files
  • copytodest: (optional) filename pattern to copy extra resources like DTD, XML, or properties files that were found in the input classes path(s). By defaults, only .class files will be handled. It is ignored if destdir is not set.

Use the following parameters to configure the classpath to point to the classes to be weaved. Those can be specified with nested elements as well/instead:

  • properties path=..: extra path to a properties file where user-defined annotations are to be used
  • classpath: classpath of classes to be annotated, as well as classpath to discover user-defined annotations if any
  • classpathref: classpath reference of classes to be annotated, as well as classpath to discover user-defined annotations if any
  • srcdir: directory where to find annotated java source files
  • sourcepath: path where to find annotated java source files
  • sourcepathref: path reference where to find annotated java source files

Nested elements are similar to the javac task when you configure a classpath and a sourcepath:

  • classpath: Path-like structure of classes to annotated, as well as classpath to discover user-defined annotations if any
  • src: single path entry of annotated java source files
  • sourcepath: Path-like structure of annotated java source files
  • fileset: fileset to contain annotated java source files
  • No labels