The exceptions-codes Ant task provides the following attributes.
Attribute | Required? | Default | Description |
---|---|---|---|
projectName | yes | Ant project name | The name of the project to collect information for. Used for the report header. |
reportFile | yes | none | The name of the report file to write. |
reportGeneratorClass | yes | HtmlReportGenerator | The class name of the report generator instance to use. |
reportEncoding | yes | UTF-8 | The encoding of the generated report documentation. |
reportExcludes | no | none | The semicolon separated excluded directories. Use Ant syntax. |
reportIncludes | no | none | The semicolon separated included directories. Use Ant syntax. |
sourceEncoding | yes | UTF-8 | The encoding of the Java source files. |
cssFile | no | none | The link reference to the CSS file to add to the head element of the generated HTML document. |
classpath | this or classpathref | none | The classpath to search for exception code classes. |
classpathref | this or classpath | none | The classpath to search for exception code classes. |
sourcepath | this or sourcepathref | none | The sourcepath to search for Javadoc for the exception code classes found in the classpath. |
sourcepathref | this or sourcepath | none | The sourcepath to search for Javadoc for the exception code classes found in the classpath. |
The following Ant buildfile serves as an example how to use the exception-codes Ant task. Let repository point to the directory where the task jar is installed and workspace point to the directory within the source files and dependencies can be found.
<project name="MyProject" basedir="."> <path id="exceptioncodes-report.path.class"> <fileset dir="${workspace}/smart-exceptions-1/exceptioncodes-ant/target/dependency"> <include name="*.jar"/> </fileset> <pathelement location="${repository}/exceptioncodes-ant.jar"/> </path> <path id="exceptioncodes-report.path.source"> <pathelement location="${workspace}/smartexceptions/smart-exceptions-1/smart-exceptions-i18n/src/main/java"/> </path> <taskdef name="exceptioncodes-report" classname="de.smartics.exceptions.ant.ExceptionCodesReportTask" classpathref="exceptioncodes-report.path.class"/> <target name="generate-exception-codes-report"> <exceptioncodes-report reportFile="my-test-report.html" reportIncludes="de/smartics/**" cssFile="test.css" classpathref="exceptioncodes-report.path.class" sourcepathref="exceptioncodes-report.path.source"/> </target> </project>
If you use the exceptioncodes-ant-allclasses.jar the specification of the classpath for the Ant task is somewhat simpler:
<path id="exceptioncodes-report.path.class"> <pathelement location="exceptioncodes-ant-allclasses.jar"/> </path>