2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2001-06-01 04:43:03 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2018-01-22 23:52:21 +01:00
|
|
|
<title>JDepend Task</title>
|
2001-06-01 04:43:03 +00:00
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
|
|
|
</head>
|
2001-08-30 13:23:14 +00:00
|
|
|
|
2001-06-01 04:43:03 +00:00
|
|
|
<body>
|
|
|
|
|
2018-01-22 23:52:21 +01:00
|
|
|
<h2 id="jdepend">JDepend</h2>
|
2001-08-30 13:23:14 +00:00
|
|
|
|
|
|
|
<h3>Description</h3>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
2018-03-08 07:43:53 +01:00
|
|
|
<p>Invokes the <a href="http://www.clarkware.com/software/JDepend.html" target="_top">JDepend</a>
|
|
|
|
parser.</p>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<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>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Source file directories are defined by nested <code><sourcespath></code>. Class file
|
|
|
|
directories are defined by nested <code><classespath></code>. See <a href="#nested">nested
|
|
|
|
elements</a>.</p>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Optionally, you can also set the <var>outputfile</var> name where the output is stored. By
|
|
|
|
default the task writes its report to the standard output.</p>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
2018-01-22 23:52:21 +01:00
|
|
|
<p>The task requires at least the JDepend 1.2 version.</p>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
2001-08-30 13:23:14 +00:00
|
|
|
<h3>Parameters</h3>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<table class="attr">
|
2001-08-30 13:23:14 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<th>Attribute</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Required</th>
|
2001-08-30 13:23:14 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>outputfile</td>
|
|
|
|
<td>The output file name. If not set, the output is printed on the standard output.</td>
|
|
|
|
<td>No</td>
|
2001-08-30 13:23:14 +00:00
|
|
|
</tr>
|
2001-10-16 10:12:23 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>format</td>
|
|
|
|
<td>The format to write the output in,
|
|
|
|
either <q>text</q> (default) or <q>xml</q></td>
|
|
|
|
<td>No; the default is <q>text</q></td>
|
2001-10-16 10:12:23 +00:00
|
|
|
</tr>
|
2001-08-30 13:23:14 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>fork</td>
|
|
|
|
<td>Run the tests in a separate JVM.</td>
|
|
|
|
<td>No; default is <q>off</q></td>
|
2001-08-30 13:23:14 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>haltonerror</td>
|
|
|
|
<td>Stop the build process if an error occurs during the <code>jdepend</code> analysis.</td>
|
|
|
|
<td>No; default is <q>off</q></td>
|
2001-08-30 13:23:14 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>timeout</td>
|
|
|
|
<td>Cancel the operation if it doesn't finish in the given time (measured in milliseconds).</td>
|
|
|
|
<td>No, ignored if <var>fork</var> is <q>false</q></td>
|
2001-08-30 13:23:14 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>jvm</td>
|
|
|
|
<td>The command used to invoke JVM. The command is resolved
|
|
|
|
by <code>java.lang.Runtime.exec()</code>.</td>
|
|
|
|
<td>No; default <q>java</q>, ignored if <var>fork</var> is <q>false</q></td>
|
2001-08-30 13:23:14 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>dir</td>
|
|
|
|
<td>The directory to invoke JVM in.</td>
|
|
|
|
<td>No, ignored if <var>fork</var> is <q>false</q></td>
|
2001-08-30 13:23:14 +00:00
|
|
|
</tr>
|
2003-11-03 15:34:13 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>includeruntime</td>
|
|
|
|
<td>Implicitly add the classes required to run <code>jdepend</code> in forked mode. <em>Since
|
|
|
|
Apache Ant 1.6</em>.</td>
|
|
|
|
<td>No; default is <q>no</q>, ignored if <var>fork</var> is <q>false</q></td>
|
2003-11-03 15:34:13 +00:00
|
|
|
</tr>
|
2001-08-30 13:23:14 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>classpathref</td>
|
|
|
|
<td>the <var>classpath</var> to use, given as reference to a PATH defined elsewhere.</td>
|
|
|
|
<td>No</td>
|
2001-08-30 13:23:14 +00:00
|
|
|
</tr>
|
2001-06-01 04:43:03 +00:00
|
|
|
</table>
|
|
|
|
|
2018-03-05 17:35:30 +01:00
|
|
|
<h3 id="nested">Parameters specified as nested elements</h3>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p><code>jdepend</code> supports four nested
|
|
|
|
elements: <code><classpath></code>, <code><classespath></code>
|
|
|
|
and <code><sourcespath></code>, that represent <a href="../using.html#path">path-like
|
|
|
|
structures</a>, and <code><exclude></code>.</p>
|
|
|
|
|
|
|
|
<p><code><sourcespath></code> is used to define the paths of the source code to analyze, but
|
|
|
|
it is deprecated. With version 2.5 of JDepend, only class files are analyzed. The nested
|
|
|
|
element <code><classespath></code> replaces <code><sourcespath></code> and is used to
|
|
|
|
define the paths of compiled class code to analyze; the <code><sourcespath></code> variable is
|
|
|
|
still available in case you are using an earlier version of JDepend.
|
|
|
|
The <code><exclude></code> element can be used to set packages to ignore (requires JDepend 2.5
|
|
|
|
or above).</p>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
2001-08-30 13:23:14 +00:00
|
|
|
<h3>Examples</h3>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
|
|
|
<pre>
|
2002-09-03 15:24:08 +00:00
|
|
|
<jdepend classpathref="base.path">
|
2018-02-08 22:56:19 +01:00
|
|
|
<classespath>
|
|
|
|
<pathelement location="build"/>
|
|
|
|
</classespath>
|
2018-02-28 07:58:59 +01:00
|
|
|
</jdepend></pre>
|
2001-08-30 13:23:14 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>This invokes JDepend on the <samp>build</samp> directory, writing the output on the standard
|
|
|
|
output. The classpath is defined using a classpath reference.</p>
|
2018-02-09 06:54:03 +01:00
|
|
|
|
2001-06-01 04:43:03 +00:00
|
|
|
<pre>
|
2002-09-03 15:24:08 +00:00
|
|
|
<jdepend outputfile="docs/jdepend.xml" fork="yes" format="xml">
|
2018-02-08 22:56:19 +01:00
|
|
|
<sourcespath>
|
|
|
|
<pathelement location="src"/>
|
|
|
|
</sourcespath>
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="classes"/>
|
|
|
|
<pathelement location="lib/jdepend.jar"/>
|
|
|
|
</classpath>
|
2018-02-28 07:58:59 +01:00
|
|
|
</jdepend></pre>
|
2003-04-02 12:00:27 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>This invokes JDepend in a separate JVM on the <samp>src</samp> and <samp>testsrc</samp>
|
|
|
|
directories, writing the output to the <samp>docs/jdepend.xml</samp> file in xml format. The
|
2018-01-22 23:52:21 +01:00
|
|
|
classpath is defined using nested elements.</p>
|
2002-09-04 11:05:19 +00:00
|
|
|
|
2003-04-02 12:00:27 +00:00
|
|
|
<pre>
|
|
|
|
<jdepend classpathref="base.path">
|
2018-02-08 22:56:19 +01:00
|
|
|
<exclude name="java.*>
|
|
|
|
<exclude name="javax.*>
|
|
|
|
<classespath>
|
|
|
|
<pathelement location="build"/>
|
|
|
|
</classespath>
|
2018-02-28 07:58:59 +01:00
|
|
|
</jdepend></pre>
|
2001-06-01 04:43:03 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>This invokes JDepend with the build directory as the base for class files to analyze, and will
|
|
|
|
ignore all classes in the <samp>java.*</samp> and <samp>javax.*</samp> packages.</p>
|
2001-08-30 13:23:14 +00:00
|
|
|
|
2001-06-01 04:43:03 +00:00
|
|
|
</body>
|
|
|
|
</html>
|