source: release-kits/lirk3/resources/gs3-release-maker/apache-ant-1.6.5/docs/manual/OptionalTasks/jdepend.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 5.9 KB
Line 
1<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
3<html>
4<head>
5 <title>JDepend Task</title>
6 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
7 <meta http-equiv="Content-Language" content="en-us">
8<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
9</head>
10
11<body>
12
13<h2><a NAME="JDepend"></a>JDepend</h2>
14
15<h3>Description</h3>
16
17<P>Invokes the <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> parser.</P>
18
19<P>This parser &quot;traverses a set of Java source file directories and generates design quality metrics for each Java package&quot;.
20It allows to &quot;automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to
21effectively manage and control package dependencies.&quot;</P>
22
23<p>Source file directories are defined by nested
24<code>&lt;sourcespath&gt;</code>; Class file directories are defined
25by nested <code>&lt;classesespath&gt;</code>, see <a
26href="#nested">nested elements</a>.</p>
27
28<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>
29
30<p> The task requires at least the JDepend 1.2 version. </p>
31
32<h3>Parameters</h3>
33
34<table BORDER=1 CELLSPACING=0 CELLPADDING=2 >
35 <tr>
36 <td VALIGN=TOP><b>Attribute</b></td>
37 <td VALIGN=TOP><b>Description</b></td>
38 <td ALIGN=CENTER VALIGN=TOP><b>Required</b></td>
39 </tr>
40 <tr>
41 <td VALIGN=TOP>outputfile</td>
42 <td VALIGN=TOP>The output file name. If not set, the output is printed on the standard output.</td>
43 <td ALIGN=CENTER VALIGN=TOP>No</td>
44 </tr>
45 <tr>
46 <td VALIGN=TOP>format</td>
47 <td VALIGN=TOP>The format to write the output in. The default is "text", the alternative is "xml"</td>
48 <td ALIGN=CENTER VALIGN=TOP>No</td>
49 </tr>
50 <tr>
51 <td VALIGN=TOP>fork</td>
52 <td VALIGN=TOP>Run the tests in a separate VM.</td>
53 <td ALIGN=CENTER VALIGN=TOP>No, default is "off"</td>
54 </tr>
55 <tr>
56 <td VALIGN=TOP>haltonerror</td>
57 <td VALIGN=TOP>Stop the build process if an error occurs during the jdepend analysis.</td>
58 <td ALIGN=CENTER VALIGN=TOP>No, default is "off"</td>
59 </tr>
60 <tr>
61 <td VALIGN=TOP>timeout</td>
62 <td VALIGN=TOP>Cancel the operation if it doesn't finish in the given time (measured in milliseconds). (Ignored if fork is disabled.)</td>
63 <td ALIGN=CENTER VALIGN=TOP>No</td>
64 </tr>
65 <tr>
66 <td VALIGN=TOP>jvm</td>
67 <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>
68 <td ALIGN=CENTER VALIGN=TOP>No, default "java"</td>
69 </tr>
70 <tr>
71 <td VALIGN=TOP>dir</td>
72 <td VALIGN=TOP>The directory to invoke the VM in. (Ignored if fork is disabled)</td>
73 <td ALIGN=CENTER VALIGN=TOP>No</td>
74 </tr>
75 <tr>
76 <td VALIGN=TOP>includeruntime</td>
77 <td VALIGN=TOP>Implicitly add the classes required to run jdepend
78 in forked mode. (Ignored if fork is disabled). Since ant 1.6.</td>
79 <td ALIGN=CENTER VALIGN=TOP>No, default is "no".</td>
80 </tr>
81 <tr>
82 <td VALIGN=TOP>classpathref</td>
83 <td VALIGN=TOP>the classpath to use, given as reference to a PATH defined elsewhere.</td>
84 <td ALIGN=CENTER VALIGN=TOP>No</td>
85 </tr>
86</table>
87
88<h3><a name="nested">Nested Elements</a></h3>
89
90<p><code>jdepend</code> supports four nested elements:
91<code>&lt;classpath&gt;, &lt;classespath&gt; </code> and
92<code>&lt;sourcespath&gt;</code>, that represent <a
93href="../using.html#path">PATH like structures</a>, and
94<code>&lt;exclude&gt;</code>.</p>
95
96<p><code>&lt;sourcespath&gt;</code> is used to define the paths of the
97source code to analyze, but it is deprecated. With version 2.5 of
98JDepend, only class files are analyzed. The nested element
99<code>&lt;classespath&gt;</code> replaces <code>&lt;sourcespath&gt;</code> and is used to define
100the paths of compiled class code to analyze; the <code>&lt;sourcespath&gt;</code>
101variable is still available in case you are using an earlier version
102of JDepend. The <code>&lt;exclude&gt;</code> element can be used to set packages
103to ignore (requires JDepend 2.5 or above).</p>
104
105<h3>Examples</h3>
106
107<blockquote>
108<pre>
109&lt;jdepend classpathref="base.path"&gt;
110&nbsp;&nbsp;&nbsp; &lt;classespath&gt;
111&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pathelement location="build"/&gt;
112&nbsp;&nbsp;&nbsp; &lt;/classespath&gt;
113&lt;/jdepend&gt;
114
115</pre>
116</blockquote>
117
118<p>This invokes JDepend on the <code>build</code> directory, writing
119the output on the standard output. The classpath is defined using a
120classpath reference.</p>
121
122<blockquote>
123<pre>
124&lt;jdepend outputfile="docs/jdepend.xml" fork="yes" format="xml"&gt;
125&nbsp;&nbsp;&nbsp; &lt;sourcespath&gt;
126&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pathelement location="src"/&gt;
127&nbsp;&nbsp;&nbsp; &lt;/sourcespath&gt;
128&nbsp;&nbsp;&nbsp; &lt;classpath&gt;
129&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pathelement location="classes"/&gt;
130&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pathelement location="lib/jdepend.jar"/&gt;
131&nbsp;&nbsp;&nbsp; &lt;/classpath&gt;
132&lt;/jdepend&gt;
133</pre>
134</blockquote>
135
136<p>This invokes JDepend in a separate VM on the <code>src</code> and
137<code>testsrc</code> directories, writing the output to the
138<code>&lt;docs/jdepend.xml&gt;</code> file in xml format. The
139classpath is defined using nested elements. </p>
140
141<blockquote>
142<pre>
143&lt;jdepend classpathref="base.path"&gt;
144&nbsp;&nbsp;&nbsp; &lt;exclude name="java.*&gt;
145&nbsp;&nbsp;&nbsp; &lt;exclude name="javax.*&gt;
146&nbsp;&nbsp;&nbsp; &lt;classespath&gt;
147&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pathelement location="build"/&gt;
148&nbsp;&nbsp;&nbsp; &lt;/classespath&gt;
149&lt;/jdepend&gt;
150</pre>
151</blockquote>
152
153<p>This invokes JDepend with the build directory as the base for class
154files to analyze, and will ignore all classes in the java.* and
155javax.* packages.</p>
156
157<hr>
158<p align="center">Copyright &copy; 2001-2004 The Apache Software Foundation. All rights
159Reserved.</p>
160</body>
161</html>
162
163
Note: See TracBrowser for help on using the repository browser.