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.

icontract.html 6.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Apache Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="icontract">icontract</a></h2>
  8. <h3>Description</h3>
  9. <P>
  10. Instruments Java classes with <a href="http://www.reliable-systems.com/tools/">iContract</a>
  11. DBC preprocessor.<br>
  12. The task can generate a properties file for <a href="http://home.sol.no/~hellesoy/icplus.html">iControl</a>,
  13. a graphical user interface that lets you turn on/off assertions. iControl generates a control file that you can refer to
  14. from this task using the controlfile attribute.
  15. </p>
  16. <h3>Parameters</h3>
  17. <table border="1" cellpadding="2" cellspacing="0">
  18. <tr>
  19. <td valign="top"><b>Attribute</b></td>
  20. <td valign="top"><b>Description</b></td>
  21. <td align="center" valign="top"><b>Required</b></td>
  22. </tr>
  23. <tr>
  24. <td valign="top">srcdir</td>
  25. <td valign="top">Location of the java files.</td>
  26. <td valign="top" align="center">Yes</td>
  27. </tr>
  28. <tr>
  29. <td valign="top">instrumentdir</td>
  30. <td valign="top">Indicates where the instrumented source files should go.</td>
  31. <td valign="top" align="center">Yes</td>
  32. </tr>
  33. <tr>
  34. <td valign="top">repositorydir</td>
  35. <td valign="top">Indicates where the repository source files should go.</td>
  36. <td valign="top" align="center">Yes</td>
  37. </tr>
  38. <tr>
  39. <td valign="top">builddir</td>
  40. <td valign="top">Indicates where the compiled instrumented classes should go.
  41. Defaults to the value of instrumentdir.
  42. <em>NOTE:</em> Don't use the same directory for compiled instrumented classes
  43. and uninstrumented classes. It will break the dependency checking. (Classes will
  44. not be reinstrumented if you change them).</td>
  45. <td valign="top" align="center">No</td>
  46. </tr>
  47. <tr>
  48. <td valign="top">repositorybuilddir</td>
  49. <td valign="top">Indicates where the compiled repository classes should go.
  50. Defaults to the value of repositorydir.</td>
  51. <td valign="top" align="center">No</td>
  52. </tr>
  53. <tr>
  54. <td valign="top">pre</td>
  55. <td valign="top">Indicates whether or not to instrument for preconditions.
  56. Defaults to <code>true</code> unless controlfile is specified, in which case it
  57. defaults to <code>false</code>.</td>
  58. <td valign="top" align="center">No</td>
  59. </tr>
  60. <tr>
  61. <td valign="top">post</td>
  62. <td valign="top">Indicates whether or not to instrument for postconditions.
  63. Defaults to <code>true</code> unless controlfile is specified, in which case it
  64. defaults to <code>false</code>.</td>
  65. <td valign="top" align="center">No</td>
  66. </tr>
  67. <tr>
  68. <td valign="top">invariant</td>
  69. <td valign="top">Indicates whether or not to instrument for invariants.
  70. Defaults to <code>true</code> unless controlfile is specified, in which case it
  71. defaults to <code>false</code>.</td>
  72. <td valign="top" align="center">No</td>
  73. </tr>
  74. <tr>
  75. <td valign="top">failthrowable</td>
  76. <td valign="top">The full name of the Throwable (Exception) that should be
  77. thrown when an assertion is violated. Defaults to <code>java.lang.Error</code></td>
  78. <td valign="top" align="center">No</td>
  79. </tr>
  80. <tr>
  81. <td valign="top">verbosity</td>
  82. <td valign="top">Indicates the verbosity level of iContract. Any combination
  83. of <code>error*,warning*,note*,info*,progress*,debug*</code> (comma separated) can be
  84. used. Defaults to <code>error*</code></td>
  85. <td valign="top" align="center">No</td>
  86. </tr>
  87. <tr>
  88. <td valign="top">quiet</td>
  89. <td valign="top">Indicates if iContract should be quiet. Turn it off if many your classes extend uninstrumented classes
  90. and you don't want warnings about this. Defaults to <code>false</code></td>
  91. <td valign="top" align="center">No</td>
  92. </tr>
  93. <tr>
  94. <td valign="top">updateicontrol</td>
  95. <td valign="top">If set to true, it indicates that the properties file for
  96. iControl in the current directory should be updated (or created if it doesn't exist).
  97. Defaults to <code>false</code>.</td>
  98. <td valign="top" align="center">No</td>
  99. </tr>
  100. <tr>
  101. <td valign="top">controlfile</td>
  102. <td valign="top">The name of the control file to pass to iContract. Consider using iControl to generate the file.
  103. Default is not to pass a file. </td>
  104. <td valign="top" align="center">Only if <code>updateicontrol=true</code></td>
  105. </tr>
  106. <tr>
  107. <td valign="top">classdir</td>
  108. <td valign="top">Indicates where compiled (unistrumented) classes are located.
  109. This is required in order to properly update the icontrol.properties file, not
  110. for instrumentation.</td>
  111. <td valign="top" align="center">Only if <code>updateicontrol=true</code></td>
  112. </tr>
  113. <tr>
  114. <td valign="top">targets</td>
  115. <td valign="top">Name of the file that will be generated by this task, which lists all the
  116. classes that iContract will instrument. If specified, the file will not be deleted after execution.
  117. If not specified, a file will still be created, but it will be deleted after execution.</td>
  118. <td valign="top" align="center">No</td>
  119. </tr>
  120. </table>
  121. <p>
  122. <b>Note:</b> iContract will use the java compiler indicated by the project's
  123. <code>build.compiler</code> property. See documentation of the Javac task for
  124. more information. Nested includes and excludes are also supported.</p>
  125. <p><b>Example:</b></p>
  126. <p>
  127. <b>Note:</b> iContract will use the java compiler indicated by the project's
  128. <code>build.compiler</code> property. See documentation of the Javac task for
  129. more information.</p>
  130. <p>
  131. Nested includes and excludes can be done very much the same way as any subclass
  132. of MatchingTask.</p>
  133. <p><b>Example:</b></p>
  134. <pre>
  135. &lt;icontract
  136. srcdir=&quot;${build.src}&quot;
  137. instrumentdir=&quot;${build.instrument}&quot;
  138. repositorydir=&quot;${build.repository}&quot;
  139. builddir=&quot;${build.instrclasses}&quot;
  140. updateicontrol=&quot;true&quot;
  141. classdir=&quot;${build.classes}&quot;
  142. controlfile=&quot;control&quot;
  143. targets=&quot;targets&quot;
  144. verbosity=&quot;error*,warning*&quot;
  145. quiet=&quot;true&quot;
  146. &gt;
  147. &lt;classpath refid=&quot;compile-classpath&quot;/&gt;
  148. &lt;/icontract&gt;
  149. </pre>
  150. <hr>
  151. <p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
  152. Reserved.</p>
  153. </body>
  154. </html>