diff --git a/docs/anttask.html b/docs/anttask.html index 3e27768dc..319383e7d 100644 --- a/docs/anttask.html +++ b/docs/anttask.html @@ -286,6 +286,40 @@ This task is included in the checkstyle distribution.
</checkstyle> +Run checkstyle in an automated build and send an email report if style violations are detected
+
+ <target name="checkstyle"
+ description="Generates a report of code convention violations.">
+
+ <checkstyle failureProperty="checkstyle.failure"
+ failOnViolation="false">
+ <formatter type="xml" tofile="checkstyle_report.xml"/>
+ <fileset dir="src" includes="**/*.java"/>
+ </checkstyle>
+
+ <style in="checkstyle_report.xml" out="checkstyle_report.html" style="checkstyle.xsl"/>
+
+ </target>
+
+ <!-- run this target as part of automated build -->
+ <target name="checkstyle-nightly"
+ depends="checkstyle"
+ if="checkstyle.failure"
+ description="Sends email if checkstyle detected code conventions violations.">
+
+ <!-- use your own server and email addresses below. See Ant documentation for details -->
+
+ <mail from="qa@some.domain"
+ tolist="someone@some.domain,someoneelse@some.domain"
+ mailhost="mailbox.some.domain"
+ subject="Checkstyle violation(s) in project ${ant.project.name}"
+ files="checkstyle_report.html"/>
+
+ </target>
+
+
+
+
Copyright © 2001 Oliver Burn. All rights Reserved.