[Japi-cvs] SF.net SVN: japi:[1198] common/trunk
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2009-02-27 11:59:08
|
Revision: 1198 http://japi.svn.sourceforge.net/japi/?rev=1198&view=rev Author: christianhujer Date: 2009-02-27 11:58:59 +0000 (Fri, 27 Feb 2009) Log Message: ----------- Add pmd to common build. Currently it is optional and needs to be triggered manually. Will be enabled as soon as all pmd issues are fixed. Modified Paths: -------------- common/trunk/commonBuild.xml Added Paths: ----------- common/trunk/pmd_checks.xml Modified: common/trunk/commonBuild.xml =================================================================== --- common/trunk/commonBuild.xml 2009-02-27 11:58:10 UTC (rev 1197) +++ common/trunk/commonBuild.xml 2009-02-27 11:58:59 UTC (rev 1198) @@ -88,6 +88,7 @@ <available property="hasCheckstyle" file="${commonPath}/antlib.auto/checkstyle-all-4.4.jar" /> <available property="hasJunit" file="${commonPath}/antlib.auto/junit.jar" /> <available property="hasPack200" file="${commonPath}/antlib.auto/Pack200Task.jar" /> +<available property="hasPmd" file="${commonPath}/antlib.auto/pmd-4.2.5.jar" /> <available property="hasTaglets" file="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> <!-- targets are sorted alphabetically. --> @@ -490,3 +491,26 @@ <report format="frames" todir="docs/test" /> </junitreport> </target> + +<target name="getPmd" unless="hasPmd"> + <mkdir dir="${commonPath}/antlib.auto" /> + <get src="http://downloads.sourceforge.net/pmd/pmd-bin-4.2.5.zip" dest="${commonPath}/antlib.auto/pmd-bin-4.2.5.zip" usetimestamp="true" /> + <unzip src="${commonPath}/antlib.auto/pmd-bin-4.2.5.zip" dest="${commonPath}/antlib.auto"> + <patternset includes="**/lib/pmd-4.2.5.jar" /> + <mapper type="flatten" /> + </unzip> +</target> + +<target name="pmd" description="Performs quality checks using PMD." depends="compile,getPmd"> + <taskdef name="pmd" classpath="${commonPath}/antlib.auto/pmd-4.2.5/lib/pmd-4.2.5.jar" classname="net.sourceforge.pmd.ant.PMDTask"/> + <pmd shortFilenames="true" failOnError="true" failOnRuleViolation="true"> + <ruleset>${commonPath}/pmd_checks.xml</ruleset> + <formatter type="text" toConsole="true" /> + <fileset dir="src/prj"> + <include name="**/*.java"/> + </fileset> + <fileset dir="src/tst"> + <include name="**/*.java"/> + </fileset> + </pmd> +</target> Added: common/trunk/pmd_checks.xml =================================================================== --- common/trunk/pmd_checks.xml (rev 0) +++ common/trunk/pmd_checks.xml 2009-02-27 11:58:59 UTC (rev 1198) @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<ruleset name="Custom ruleset" + xmlns="http://pmd.sf.net/ruleset/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" + xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" +> + <description> + PMD Ruleset for JAPI. + </description> + + <rule ref="rulesets/basic.xml"> + <exclude name="EmptyCatchBlock" /> + </rule> + <rule ref="rulesets/basic.xml/EmptyCatchBlock"> + <properties> + <property name="allowCommentedBlocks" value="true" /> + </properties> + </rule> + +</ruleset> Property changes on: common/trunk/pmd_checks.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |