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