You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

jdepend.html 5.9 KiB

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