ANT - Checkstyle with custom check
"Thomas Suckow" <[email protected]>
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <[email protected]> |
I started using checkstyle with ant about a week ago. It went smooth. Trying to add custom checks is kicking my butt. I have a check TabOnlyForIndent extends Check in package org.hopto.defcon1.checks; I packaged as a jar from eclipse, it has an empty manifest (besides version). in ant i load checkstyle and put my jar in the classpath: <taskdef resource="checkstyletask.properties"> <classpath> <pathelement location="lib/checkstyle-5.0-beta01/checkstyle-all-5.0-beta01.jar"/> <pathelement location="lib/Defcon1Checks.jar"/> </classpath> </taskdef> I add my check to the config <!-- <module name="TabCharacter"/> Viva La \t --> <module name="org.hopto.defcon1.checks.TabOnlyForIndent"/> <module name="WhitespaceAfter"/> Have my checkstyle target in ant <target name="checkstyle" depends="compile" description="Checks that we are using consistant well formed style."> <checkstyle config="config_checkstyle.xml" failOnViolation="false"> <fileset dir="src" includes="**/*.java"/> <formatter type="xml" toFile="checkstyle-result.xml"/> </checkstyle> </target> And kaboom: Unable to create a Checker: cannot initialize module TreeWalker - Unable to instantiate org.hopto.defcon1.checks.TabOnlyForIndent I've tried compiling my check under java 6 and specifying target 1.4 Tryed various ways of including in classpath Ideas, Thoughts, Recommendations? Thomas Suckow ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/