The Ant task now accepts the short names of rulesets (e.g., unusedcode for rulesets/unusedcode.xml).

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3621 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2005-06-27 01:23:55 +00:00
parent c7c4baaebf
commit 7046d5833b
4 changed files with 8 additions and 3 deletions

View File

@ -71,7 +71,7 @@
<target name="pmd" description="Runs PMD">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"/>
<pmd rulesetfiles="rulesets/unusedcode.xml" shortFilenames="true">
<pmd rulesetfiles="unusedcode" shortFilenames="true">
<formatter type="text" toFile="rpt.txt"/>
<fileset dir="/usr/local/java/src/java/lang/ref/">
<include name="**/*.java"/>

View File

@ -1,8 +1,9 @@
????, 2005 - 3.3:
Implemented RFE 1220171 - rule definitions can now contain a link to an external URL for more information on that rule - for example, a link to the rule's web page. Thanks to Wouter Zelle for designing and implementing this!
Fixed bug 1226858 - JUnitAssertionsShouldIncludeMessage now checks calls to assertFalse.
Fixed bug 1226858 - JUnitAssertionsShouldIncludeMessage now checks calls to assertFalse.
Fixed a bug in RuleSetFactory that missed some override cases; thx to Wouter Zelle for the report and a fix.
Improved UseCorrectExceptionLogging; thx to Wouter Zelle for the new XPath.
Fixed a bug in RuleSetFactory that missed some override cases.
The Ant task now accepts the short names of rulesets (e.g., unusedcode for rulesets/unusedcode.xml).
June 21, 2005 - 3.2:
New rules: UseCorrectExceptionLogging (logging-jakarta-commons ruleset), AvoidPrintStackTrace (logging-java ruleset), CompareObjectsWithEquals (design ruleset)

View File

@ -51,6 +51,7 @@ public class SimpleRuleSetNameMapper {
nameMap.put("finalizers", "rulesets/finalizers.xml");
nameMap.put("imports", "rulesets/imports.xml");
nameMap.put("logging-java", "rulesets/logging-java.xml");
nameMap.put("logging-jakarta", "rulesets/logging-jakarta-commons.xml");
nameMap.put("junit", "rulesets/junit.xml");
nameMap.put("javabeans", "rulesets/javabeans.xml");
nameMap.put("naming", "rulesets/naming.xml");

View File

@ -13,6 +13,7 @@ import net.sourceforge.pmd.RuleSetFactory;
import net.sourceforge.pmd.RuleSetNotFoundException;
import net.sourceforge.pmd.TargetJDK1_3;
import net.sourceforge.pmd.TargetJDK1_5;
import net.sourceforge.pmd.SimpleRuleSetNameMapper;
import net.sourceforge.pmd.renderers.Renderer;
import net.sourceforge.pmd.renderers.TextRenderer;
import org.apache.tools.ant.AntClassLoader;
@ -118,7 +119,9 @@ public class PMDTask extends Task {
public void execute() throws BuildException {
validate();
ruleSetFiles = new SimpleRuleSetNameMapper(ruleSetFiles).getRuleSets();
RuleSet rules;
try {
RuleSetFactory ruleSetFactory = new RuleSetFactory();
if (classpath == null) {