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

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