diff --git a/docs/pages/pmd/userdocs/cpd/cpd.md b/docs/pages/pmd/userdocs/cpd/cpd.md index 73b7368f1c..ab65964e5e 100644 --- a/docs/pages/pmd/userdocs/cpd/cpd.md +++ b/docs/pages/pmd/userdocs/cpd/cpd.md @@ -333,8 +333,14 @@ For details, see [CPD Report Formats](pmd_userdocs_cpd_report_formats.html). Andy Glover wrote an Ant task for CPD; here's how to use it: ```xml + + + + + + + - diff --git a/docs/pages/pmd/userdocs/tools/ant.md b/docs/pages/pmd/userdocs/tools/ant.md index ae3abbcbab..8306bae2ff 100644 --- a/docs/pages/pmd/userdocs/tools/ant.md +++ b/docs/pages/pmd/userdocs/tools/ant.md @@ -181,7 +181,6 @@ automatically and the latest language version is used. `ruleset` nested element - another way to specify rulesets. You can specify multiple elements. Here's an example: - rulesets/java/quickstart.xml config/my-ruleset.xml @@ -373,7 +372,6 @@ You can run pmd then with `ant pmd`. An HTML report with the "linkPrefix" and "linePrefix" properties: - diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java index 177f1311de..85abfdc0ad 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java @@ -40,20 +40,26 @@ import net.sourceforge.pmd.lang.LanguageRegistry; * *

Runs the CPD utility via ant. The ant task looks like this:

* - *
- * <project name="CPDProj" default="main" basedir=".">
- *   <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" />
- *   <target name="main">
- *     <cpd encoding="UTF-16LE" language="java" ignoreIdentifiers="true"
- *          ignoreLiterals="true" ignoreAnnotations="true" minimumTokenCount="100"
- *          outputFile="c:\cpdrun.txt">
- *       <fileset dir="/path/to/my/src">
- *         <include name="*.java"/>
- *       </fileset>
- *     </cpd>
- *   </target>
- * </project>
- * 
+ *
{@code
+ *   
+ *     
+ *         
+ *             
+ *         
+ *     
+ *     
+ *
+ *     
+ *       
+ *         
+ *           
+ *         
+ *       
+ *     
+ *   
+ * }
* *

Required: minimumTokenCount, outputFile, and at least one file

*/ diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java index 578db83ca5..db10833ff7 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java @@ -24,6 +24,31 @@ import net.sourceforge.pmd.ant.internal.PMDTaskImpl; /** * 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:

+ * + *
{@code
+ *   
+ *     
+ *         
+ *             
+ *         
+ *     
+ *     
+ *
+ *     
+ *       
+ *         rulesets/java/quickstart.xml
+ *         config/my-ruleset.xml
+ *         
+ *             
+ *         
+ *       
+ *     
+ *   
+ * }
+ * + *

Required: rulesetfiles/ruleset, fileset

*/ public class PMDTask extends Task {