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 "traverses a set of Java source file directories and generates design quality metrics for each Java package".
|
---|
36 | It allows to "automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to
|
---|
37 | effectively manage and control package dependencies."</P>
|
---|
38 |
|
---|
39 | <p>Source file directories are defined by nested
|
---|
40 | <code><sourcespath></code>; Class file directories are defined
|
---|
41 | by nested <code><classesespath></code>, see <a
|
---|
42 | href="#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><classpath>, <classespath> </code> and
|
---|
108 | <code><sourcespath></code>, that represent <a
|
---|
109 | href="../using.html#path">PATH like structures</a>, and
|
---|
110 | <code><exclude></code>.</p>
|
---|
111 |
|
---|
112 | <p><code><sourcespath></code> is used to define the paths of the
|
---|
113 | source code to analyze, but it is deprecated. With version 2.5 of
|
---|
114 | JDepend, only class files are analyzed. The nested element
|
---|
115 | <code><classespath></code> replaces <code><sourcespath></code> and is used to define
|
---|
116 | the paths of compiled class code to analyze; the <code><sourcespath></code>
|
---|
117 | variable is still available in case you are using an earlier version
|
---|
118 | of JDepend. The <code><exclude></code> element can be used to set packages
|
---|
119 | to ignore (requires JDepend 2.5 or above).</p>
|
---|
120 |
|
---|
121 | <h3>Examples</h3>
|
---|
122 |
|
---|
123 | <blockquote>
|
---|
124 | <pre>
|
---|
125 | <jdepend classpathref="base.path">
|
---|
126 | <classespath>
|
---|
127 | <pathelement location="build"/>
|
---|
128 | </classespath>
|
---|
129 | </jdepend>
|
---|
130 |
|
---|
131 | </pre>
|
---|
132 | </blockquote>
|
---|
133 |
|
---|
134 | <p>This invokes JDepend on the <code>build</code> directory, writing
|
---|
135 | the output on the standard output. The classpath is defined using a
|
---|
136 | classpath reference.</p>
|
---|
137 |
|
---|
138 | <blockquote>
|
---|
139 | <pre>
|
---|
140 | <jdepend outputfile="docs/jdepend.xml" fork="yes" format="xml">
|
---|
141 | <sourcespath>
|
---|
142 | <pathelement location="src"/>
|
---|
143 | </sourcespath>
|
---|
144 | <classpath>
|
---|
145 | <pathelement location="classes"/>
|
---|
146 | <pathelement location="lib/jdepend.jar"/>
|
---|
147 | </classpath>
|
---|
148 | </jdepend>
|
---|
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><docs/jdepend.xml></code> file in xml format. The
|
---|
155 | classpath is defined using nested elements. </p>
|
---|
156 |
|
---|
157 | <blockquote>
|
---|
158 | <pre>
|
---|
159 | <jdepend classpathref="base.path">
|
---|
160 | <exclude name="java.*>
|
---|
161 | <exclude name="javax.*>
|
---|
162 | <classespath>
|
---|
163 | <pathelement location="build"/>
|
---|
164 | </classespath>
|
---|
165 | </jdepend>
|
---|
166 | </pre>
|
---|
167 | </blockquote>
|
---|
168 |
|
---|
169 | <p>This invokes JDepend with the build directory as the base for class
|
---|
170 | files to analyze, and will ignore all classes in the java.* and
|
---|
171 | javax.* packages.</p>
|
---|
172 |
|
---|
173 |
|
---|
174 | </body>
|
---|
175 | </html>
|
---|
176 |
|
---|
177 |
|
---|