diff --git a/docs/anttask.html b/docs/anttask.html
index 05e204221..5af743564 100644
--- a/docs/anttask.html
+++ b/docs/anttask.html
@@ -106,6 +106,13 @@ then you will need the following taskdef declaration:
diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java index 0d7ae3667..78fcc3124 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java @@ -43,6 +43,7 @@ import org.apache.tools.ant.taskdefs.LogOutputStream; import org.apache.tools.ant.types.EnumeratedAttribute; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Reference; /** * An implementation of a ANT task for calling checkstyle. See the documentation @@ -141,7 +142,21 @@ public class CheckStyleTask */ public void setClasspath(Path aClasspath) { - mClasspath = aClasspath; + if (mClasspath == null) { + mClasspath = aClasspath; + } + else { + mClasspath.append(aClasspath); + } + } + + /** + * Set the class path from a reference defined elsewhere. + * @param aClasspathRef the reference to an instance defining the classpath + */ + public void setClasspathRef(Reference aClasspathRef) + { + createClasspath().setRefid(aClasspathRef); } /** @return a created path for locating classes */