blob: a8b19025619d60ba95451e9a56da7558fe43b466 [file] [log] [blame]
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>JDepend Task</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-us">
</head>
<body>
<h2><a NAME="JDepend"></a>JDepend</h2>
<h3>Description</h3>
<P>Invokes the <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> parser.</P>
<P>This parser "traverses a set of Java source file directories and generates design quality metrics for each Java package".
It allows to "automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to
effectively manage and control package dependencies."</P>
<p>Source file directories are defined by nested <code>&lt;sourcespath&gt;</code>, see <a href="#nested">nested elements</a>.</p>
<p>Optionally, you can also set the <code>outputfile</code> name where the output is stored. By default the task writes its report to the standard output.</P>
<p> The task requires at least the JDepend 1.2 version. </p>
<P>Note: whereas the JDepend tool can be customized to exclude some packages, the current jdepend And Task does not have parameters to allow these exclusions. Read JDepend specific documentation for that purpose.</P>
<p>
<h3>Parameters</h3>
<table BORDER=1 CELLSPACING=0 CELLPADDING=2 >
<tr>
<td VALIGN=TOP><b>Attribute</b></td>
<td VALIGN=TOP><b>Description</b></td>
<td ALIGN=CENTER VALIGN=TOP><b>Required</b></td>
</tr>
<tr>
<td VALIGN=TOP>outputfile</td>
<td VALIGN=TOP>The output file name. If not set, the output is printed on the standard output.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>fork</td>
<td VALIGN=TOP>Run the tests in a separate VM.</td>
<td ALIGN=CENTER VALIGN=TOP>No, default is "off"</td>
</tr>
<tr>
<td VALIGN=TOP>haltonerror</td>
<td VALIGN=TOP>Stop the build process if an error occurs during the jdepend analysis.</td>
<td ALIGN=CENTER VALIGN=TOP>No, default is "off"</td>
</tr>
<tr>
<td VALIGN=TOP>timeout</td>
<td VALIGN=TOP>Cancel the operation if it doesn't finish in the given time (measured in milliseconds). (Ignored if fork is disabled.)</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>jvm</td>
<td VALIGN=TOP>The command used to invoke the Java Virtual Machine, default is 'java'. The command is resolved by java.lang.Runtime.exec(). (Ignored if fork is disabled.)</td>
<td ALIGN=CENTER VALIGN=TOP>No, default "java"</td>
</tr>
<tr>
<td VALIGN=TOP>dir</td>
<td VALIGN=TOP>The directory to invoke the VM in. (Ignored if fork is disabled)</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>classpathref</td>
<td VALIGN=TOP>the classpath to use, given as reference to a PATH defined elsewhere.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
</table>
<h3><a name="nested">Nested Elements</a></h3>
<p><code>jdepend</code> supports two nested elements <code>&lt;classpath&gt;</code> and <code>&lt;sourcespath&gt;</code>,
that represent <a href="../using.html#path">PATH like structures</a>.</p>
<p><code>&lt;sourcespath&gt;</code> is used to define the paths of the source code to analyze.</p>
<h3>Examples</h3>
<blockquote>
<pre>
&lt;jdepend classpathref="base.path">
&nbsp;&nbsp;&nbsp; &lt;sourcespath>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pathelement location="src" />
&nbsp;&nbsp;&nbsp; &lt;/sourcespath>
&lt;/jdepend>
</pre>
</blockquote>
This invokes JDepend on the <code>src</code> directory, writing the output on the standard output.
The classpath is defined using a classpath reference.
<blockquote>
<pre>
&lt;jdepend outputfile="docs/jdepend.txt" fork="yes">
&nbsp;&nbsp;&nbsp; &lt;sourcespath>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pathelement location="src" />
&nbsp;&nbsp;&nbsp; &lt;/sourcespath>
&nbsp;&nbsp;&nbsp; &lt;classpath>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pathelement location="classes" />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pathelement location="lib/jdepend.jar" />
&nbsp;&nbsp;&nbsp; &lt;/classpath>
&lt;/jdepend>
</pre>
</blockquote>
This invokes JDepend in a separate VM on the <code>src</code> and <code>testsrc</code> directories, writing the output in the <code>&lt;docs/jdepend.txt&gt;</code> file.
The classpath is defined using nested elements.
<hr>
</body>
</html>