Package net.sourceforge.pmd.ant
Class PMDTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
net.sourceforge.pmd.ant.PMDTask
- All Implemented Interfaces:
Cloneable
public class PMDTask
extends org.apache.tools.ant.Task
PMD Ant task. Setters of this class are interpreted by Ant as properties
settable in the XML. This is therefore published API.
Runs PMD analysis via ant. The ant task looks like this:
<project name="PMDProject" default="main" basedir=".">
<path id="pmd.classpath">
<fileset dir="/home/joe/pmd-bin-VERSION/lib">
<include name="*.jar"/>
</fileset>
</path>
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath" />
<target name="main">
<pmd>
<ruleset>rulesets/java/quickstart.xml</ruleset>
<ruleset>config/my-ruleset.xml</ruleset>
<fileset dir="/usr/local/j2sdk1.4.1_01/src/">
<include name="java/lang/*.java"/>
</fileset>
</pmd>
</target>
</project>
Required: rulesetfiles/ruleset, fileset
-
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddFileset(org.apache.tools.ant.types.FileSet set) voidvoidaddRelativizePathsWith(org.apache.tools.ant.types.Path relativizePathsWith) voidorg.apache.tools.ant.types.Pathorg.apache.tools.ant.types.Pathvoidexecute()org.apache.tools.ant.types.Pathorg.apache.tools.ant.types.PathList<org.apache.tools.ant.types.FileSet>intintList<org.apache.tools.ant.types.Path>intbooleanbooleanbooleanvoidsetAuxClasspath(org.apache.tools.ant.types.Path auxClasspath) voidsetAuxClasspathRef(org.apache.tools.ant.types.Reference r) voidsetCacheLocation(String cacheLocation) voidsetClasspath(org.apache.tools.ant.types.Path classpath) voidsetClasspathRef(org.apache.tools.ant.types.Reference r) voidsetEncoding(String sourceEncoding) voidsetFailOnError(boolean fail) voidsetFailOnRuleViolation(boolean fail) voidsetFailuresPropertyName(String failuresPropertyName) voidsetMaxRuleViolations(int max) voidsetMinimumPriority(int minPriority) voidsetNoCache(boolean noCache) voidsetRuleSetFiles(String ruleSets) voidsetSuppressMarker(String suppressMarker) voidsetThreads(int threads) Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
PMDTask
public PMDTask()
-
-
Method Details
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
setSuppressMarker
-
setFailOnError
public void setFailOnError(boolean fail) -
setFailOnRuleViolation
public void setFailOnRuleViolation(boolean fail) -
setMaxRuleViolations
public void setMaxRuleViolations(int max) -
setRuleSetFiles
-
setEncoding
-
setThreads
public void setThreads(int threads) -
setFailuresPropertyName
-
setMinimumPriority
public void setMinimumPriority(int minPriority) -
addFileset
public void addFileset(org.apache.tools.ant.types.FileSet set) -
addFormatter
-
addConfiguredSourceLanguage
-
setClasspath
public void setClasspath(org.apache.tools.ant.types.Path classpath) -
getClasspath
public org.apache.tools.ant.types.Path getClasspath() -
createClasspath
public org.apache.tools.ant.types.Path createClasspath() -
setClasspathRef
public void setClasspathRef(org.apache.tools.ant.types.Reference r) -
setAuxClasspath
public void setAuxClasspath(org.apache.tools.ant.types.Path auxClasspath) -
getAuxClasspath
public org.apache.tools.ant.types.Path getAuxClasspath() -
createAuxClasspath
public org.apache.tools.ant.types.Path createAuxClasspath() -
setAuxClasspathRef
public void setAuxClasspathRef(org.apache.tools.ant.types.Reference r) -
addRuleset
-
getFormatters
-
getFilesets
-
isFailOnError
public boolean isFailOnError() -
isFailOnRuleViolation
public boolean isFailOnRuleViolation() -
getSuppressMarker
-
getRulesetFiles
-
getEncoding
-
getThreads
public int getThreads() -
getMinimumPriority
public int getMinimumPriority() -
getMaxRuleViolations
public int getMaxRuleViolations() -
getFailuresPropertyName
-
getSourceLanguage
-
getNestedRules
-
getCacheLocation
-
setCacheLocation
-
isNoCache
public boolean isNoCache() -
setNoCache
public void setNoCache(boolean noCache) -
addRelativizePathsWith
public void addRelativizePathsWith(org.apache.tools.ant.types.Path relativizePathsWith) -
getRelativizePathsWith
-