You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by nb...@apache.org on 2007/08/10 19:36:46 UTC
svn commit: r564691 - in /velocity/tools/branches/2.x: build.properties
build.xml test.xml
Author: nbubna
Date: Fri Aug 10 10:36:45 2007
New Revision: 564691
URL: http://svn.apache.org/viewvc?view=rev&rev=564691
Log:
add support for optional PMD task
Modified:
velocity/tools/branches/2.x/build.properties
velocity/tools/branches/2.x/build.xml
velocity/tools/branches/2.x/test.xml
Modified: velocity/tools/branches/2.x/build.properties
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/build.properties?view=diff&rev=564691&r1=564690&r2=564691
==============================================================================
--- velocity/tools/branches/2.x/build.properties (original)
+++ velocity/tools/branches/2.x/build.properties Fri Aug 10 10:36:45 2007
@@ -91,6 +91,9 @@
# Needs to be configured with system location of findbugs for findbugs task
findbugs.home=*unset*
+# Needs to be configured with system location of PMD for pmd task
+pmd.home=*unset*
+
#test switches
test.haltonerror=true
test.haltonfailure=true
Modified: velocity/tools/branches/2.x/build.xml
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/build.xml?view=diff&rev=564691&r1=564690&r2=564691
==============================================================================
--- velocity/tools/branches/2.x/build.xml (original)
+++ velocity/tools/branches/2.x/build.xml Fri Aug 10 10:36:45 2007
@@ -599,8 +599,13 @@
<target name="test" description="Test VelocityTools" depends="test.generic,test.view">
</target>
+ <!-- Code Analysis targets -->
<target name="findbugs" description="Run FindBugs" depends="jar">
<ant antfile="${basedir}/test.xml" target="findbugs" />
+ </target>
+
+ <target name="pmd" description="Run PMD" depends="compile">
+ <ant antfile="${basedir}/test.xml" target="pmd" />
</target>
<!-- Generic tests -->
Modified: velocity/tools/branches/2.x/test.xml
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/test.xml?view=diff&rev=564691&r1=564690&r2=564691
==============================================================================
--- velocity/tools/branches/2.x/test.xml (original)
+++ velocity/tools/branches/2.x/test.xml Fri Aug 10 10:36:45 2007
@@ -236,4 +236,36 @@
</findbugs>
</target>
+
+ <!-- Analyze code with PMD -->
+ <target name="pmd">
+ <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
+ <classpath>
+ <fileset dir="${pmd.home}/lib">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+ <echo>Analyzing ${source.home}/main/java...</echo>
+ <pmd shortFilenames="true"
+ failonerror="true">
+<!-- To minimize noise keep rulesets that you are done checking here...
+-->
+ <ruleset>unusedcode</ruleset>
+ <ruleset>imports</ruleset>
+ <ruleset>braces</ruleset>
+<!-- ... and rulesets you're not ready to check here.
+ <ruleset>basic</ruleset>
+ <ruleset>strings</ruleset>
+ <ruleset>design</ruleset>
+ <ruleset>codesize</ruleset>
+-->
+ <formatter type="html"
+ toFile="${test.build.dir}\pmd_report.html"/>
+ <fileset dir="${source.home}/main/java">
+ <include name="**/*.java"/>
+ </fileset>
+ </pmd>
+ <echo>Generated report is at ${test.build.dir}\pmd_report.html</echo>
+ </target>
</project>