martinc 2003/01/04 18:48:22 Modified: . build.properties.sample build.xml Log: Add new tasks for running Checkstyle and PMD, if available. If the tools are not available, the tasks do nothing. Revision Changes Path 1.24 +12 -1 jakarta-struts/build.properties.sample Index: build.properties.sample =================================================================== RCS file: /home/cvs/jakarta-struts/build.properties.sample,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- build.properties.sample 29 Dec 2002 20:54:15 -0000 1.23 +++ build.properties.sample 5 Jan 2003 02:48:21 -0000 1.24 @@ -95,6 +95,17 @@ # going to execute the "deploy.catalina" target. xerces.jar=${apache.home}/xerces-1_4_4/xerces.jar +# Properties related to optional tasks +# ------------------------------------ + +# The JAR file containing the Checkstyle package version 2.4, if available. If +# you do not have Checkstyle installed, do not set this property. +checkstyle.jar = /Java/checkstyle-2.4/checkstyle-all-2.4.jar + +# The JAR file containing the PMD package version 1.01, if available. If +# you do not have PMD installed, do not set this property. +pmd.jar = /Java/pmd/lib/pmd-1.01.jar + # Properties related to Struts Contrib # ----------------------------------------- 1.91 +30 -0 jakarta-struts/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-struts/build.xml,v retrieving revision 1.90 retrieving revision 1.91 diff -u -r1.90 -r1.91 --- build.xml 4 Jan 2003 22:22:24 -0000 1.90 +++ build.xml 5 Jan 2003 02:48:21 -0000 1.91 @@ -745,6 +745,36 @@ <!-- + Source code analysis targets +--> + <target name="checkstyle" if="checkstyle.jar" + description="Checks source code against Sun coding guidelines" + depends="init"> + <taskdef name="checkstyle" + classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"> + <classpath location="${checkstyle.jar}"/> + </taskdef> + <checkstyle> + <formatter type="plain"/> + <fileset dir="${src.share.dir}" includes="**/*.java"/> + </checkstyle> + </target> + + <target name="pmd" if="pmd.jar" + description="Locates unused imports, unused variables, etc." + depends="init"> + <taskdef name="pmd" + classname="net.sourceforge.pmd.ant.PMDTask"> + <classpath location="${pmd.jar}"/> + </taskdef> + <pmd reportFile="pmdreport.html" format="html" + rulesetfiles="rulesets/unusedcode.xml,rulesets/imports.xml"> + <fileset dir="${src.share.dir}" includes="**/*.java"/> + </pmd> + </target> + + +<!-- Compile Website documenation -->
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>