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.8 KiB

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