From 9a8acc01fdfd4cea9891b0da6e01ff41226900ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lars=20K=C3=BChne?=
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.