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 "traverses a set of Java source file directories and generates design quality metrics for each Java package".
|
---|
20 | It allows to "automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to
|
---|
21 | effectively manage and control package dependencies."</P>
|
---|
22 |
|
---|
23 | <p>Source file directories are defined by nested
|
---|
24 | <code><sourcespath></code>; Class file directories are defined
|
---|
25 | by nested <code><classesespath></code>, see <a
|
---|
26 | href="#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><classpath>, <classespath> </code> and
|
---|
92 | <code><sourcespath></code>, that represent <a
|
---|
93 | href="../using.html#path">PATH like structures</a>, and
|
---|
94 | <code><exclude></code>.</p>
|
---|
95 |
|
---|
96 | <p><code><sourcespath></code> is used to define the paths of the
|
---|
97 | source code to analyze, but it is deprecated. With version 2.5 of
|
---|
98 | JDepend, only class files are analyzed. The nested element
|
---|
99 | <code><classespath></code> replaces <code><sourcespath></code> and is used to define
|
---|
100 | the paths of compiled class code to analyze; the <code><sourcespath></code>
|
---|
101 | variable is still available in case you are using an earlier version
|
---|
102 | of JDepend. The <code><exclude></code> element can be used to set packages
|
---|
103 | to ignore (requires JDepend 2.5 or above).</p>
|
---|
104 |
|
---|
105 | <h3>Examples</h3>
|
---|
106 |
|
---|
107 | <blockquote>
|
---|
108 | <pre>
|
---|
109 | <jdepend classpathref="base.path">
|
---|
110 | <classespath>
|
---|
111 | <pathelement location="build"/>
|
---|
112 | </classespath>
|
---|
113 | </jdepend>
|
---|
114 |
|
---|
115 | </pre>
|
---|
116 | </blockquote>
|
---|
117 |
|
---|
118 | <p>This invokes JDepend on the <code>build</code> directory, writing
|
---|
119 | the output on the standard output. The classpath is defined using a
|
---|
120 | classpath reference.</p>
|
---|
121 |
|
---|
122 | <blockquote>
|
---|
123 | <pre>
|
---|
124 | <jdepend outputfile="docs/jdepend.xml" fork="yes" format="xml">
|
---|
125 | <sourcespath>
|
---|
126 | <pathelement location="src"/>
|
---|
127 | </sourcespath>
|
---|
128 | <classpath>
|
---|
129 | <pathelement location="classes"/>
|
---|
130 | <pathelement location="lib/jdepend.jar"/>
|
---|
131 | </classpath>
|
---|
132 | </jdepend>
|
---|
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><docs/jdepend.xml></code> file in xml format. The
|
---|
139 | classpath is defined using nested elements. </p>
|
---|
140 |
|
---|
141 | <blockquote>
|
---|
142 | <pre>
|
---|
143 | <jdepend classpathref="base.path">
|
---|
144 | <exclude name="java.*>
|
---|
145 | <exclude name="javax.*>
|
---|
146 | <classespath>
|
---|
147 | <pathelement location="build"/>
|
---|
148 | </classespath>
|
---|
149 | </jdepend>
|
---|
150 | </pre>
|
---|
151 | </blockquote>
|
---|
152 |
|
---|
153 | <p>This invokes JDepend with the build directory as the base for class
|
---|
154 | files to analyze, and will ignore all classes in the java.* and
|
---|
155 | javax.* packages.</p>
|
---|
156 |
|
---|
157 | <hr>
|
---|
158 | <p align="center">Copyright © 2001-2004 The Apache Software Foundation. All rights
|
---|
159 | Reserved.</p>
|
---|
160 | </body>
|
---|
161 | </html>
|
---|
162 |
|
---|
163 |
|
---|