Applying patch 835896(classpathref support for Ant task)

This commit is contained in:
Oleg Sukhodolsky 2003-11-17 05:20:19 +00:00
parent 154df915b9
commit ec70b77765
3 changed files with 26 additions and 1 deletions

View File

@ -106,6 +106,13 @@ then you will need the following <code>taskdef</code> declaration:</p>
<td class="required">No</td>
</tr>
<tr>
<td>classpathref</td>
<td>The classpath to use when looking up classes, given as a reference
to a path defined elsewhere.</td>
<td class="required">No</td>
</tr>
</table>

View File

@ -71,6 +71,9 @@
<li class="body">Added caseSensitive property to ImportOrder check
(bug 842604).</li>
<li class="body">Added classpathref property to ant task
(patch 835896, from Ville Skytta (scop)).</li>
</ul>
<p class="body">

View File

@ -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 */