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.

rmic.html 10 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  5. <title>Rmic Task</title>
  6. </head>
  7. <body>
  8. <h2><a name="rmic">Rmic</a></h2>
  9. <h3>Description</h3>
  10. <p>Runs the rmic compiler for a certain class.</p>
  11. <p>Rmic can be run on a single class (as specified with the classname
  12. attribute) or a number of classes at once (all classes below base that
  13. are neither _Stub nor _Skel classes). If you want to rmic a single
  14. class and this class is a class nested into another class, you have to
  15. specify the classname in the form <code>Outer$$Inner</code> instead of
  16. <code>Outer.Inner</code>.</p>
  17. <p>It is possible to refine the set of files that are being rmiced. This can be
  18. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  19. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  20. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  21. the files you want to have excluded. This is also done with patterns. And
  22. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  23. want to use default exclusions or not. See the section on <a
  24. href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
  25. inclusion/exclusion of files works, and how to write patterns.</p>
  26. <p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and
  27. supports all attributes of <code>&lt;fileset&gt;</code>
  28. (<code>dir</code> becomes <code>base</code>) as well as the nested
  29. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  30. <code>&lt;patternset&gt;</code> elements.</p>
  31. <p>It is possible to use different compilers. This can be selected
  32. with the &quot;build.rmic&quot; property or the <code>compiler</code>
  33. attribute.
  34. <a name="compilervalues">Here are the choices</a>:</p>
  35. <ul>
  36. <li>default -the default compiler (kaffe or sun) for the platform.
  37. <li>sun (the standard compiler of the JDK)</li>
  38. <li>kaffe (the standard compiler of <a href="http://www.kaffe.org" target="_top">Kaffe</a>)</li>
  39. <li>weblogic</li>
  40. <li>forking - the sun compiler forked into a separate process (since Ant 1.7)</li>
  41. <li>xnew - the sun compiler forked into a separate process,
  42. with the -Xnew option (since Ant 1.7).
  43. This is the most reliable way to use -Xnew</li>
  44. <li> "" (empty string). This has the same behaviour as not setting the compiler attribute.
  45. First the value of <tt>build.rmic</tt> is used if defined, and if not, the default
  46. for the platform is chosen. If build.rmic is set to this, you get the default.
  47. </ul>
  48. <p>The <a href="http://dione.zcu.cz/~toman40/miniRMI/">miniRMI</a>
  49. project contains a compiler implementation for this task as well,
  50. please consult miniRMI's documentation to learn how to use it.</p>
  51. <h3>Parameters</h3>
  52. <table border="1" cellpadding="2" cellspacing="0">
  53. <tr>
  54. <td valign="top"><b>Attribute</b></td>
  55. <td valign="top"><b>Description</b></td>
  56. <td align="center" valign="top"><b>Required</b></td>
  57. </tr>
  58. <tr>
  59. <td valign="top">base</td>
  60. <td valign="top">the location to store the compiled files.</td>
  61. <td valign="top" align="center">Yes</td>
  62. </tr>
  63. <tr>
  64. <td valign="top">classname</td>
  65. <td valign="top">the class for which to run <code>rmic</code>.</td>
  66. <td valign="top" align="center">No</td>
  67. </tr>
  68. <tr>
  69. <td valign="top">filtering</td>
  70. <td valign="top">indicates whether token filtering should take place</td>
  71. <td valign="top" align="center">No</td>
  72. </tr>
  73. <tr>
  74. <td valign="top">sourcebase</td>
  75. <td valign="top">Pass the &quot;-keepgenerated&quot; flag to rmic and
  76. move the generated source file to the given sourcebase directory.</td>
  77. <td align="center" valign="top">No</td>
  78. </tr>
  79. <tr>
  80. <td valign="top">stubversion</td>
  81. <td valign="top">Specify the JDK version for the generated stub code.
  82. Specify &quot;1.1&quot; to pass the &quot;-v1.1&quot; option to rmic,
  83. "1.2" for -v12, compat for -vcompat. <br>
  84. Since Ant1.7, if you do not specify a version, and do not ask
  85. for iiop or idl files, "compat" is selected.
  86. </td>
  87. <td align="center" valign="top">No, default="compat"</td>
  88. </tr>
  89. <tr>
  90. <td valign="top">classpath</td>
  91. <td valign="top">The classpath to use during compilation</td>
  92. <td align="center" valign="top">No</td>
  93. </tr>
  94. <tr>
  95. <td valign="top">classpathref</td>
  96. <td valign="top">The classpath to use during compilation, given as <a
  97. href="../using.html#references">reference</a> to a PATH defined elsewhere</td>
  98. <td align="center" valign="top">No</td>
  99. </tr>
  100. <tr>
  101. <td valign="top">includes</td>
  102. <td valign="top">comma- or space-separated list of patterns of files that must be
  103. included. All files are included when omitted.</td>
  104. <td valign="top" align="center">No</td>
  105. </tr>
  106. <tr>
  107. <td valign="top">includesfile</td>
  108. <td valign="top">the name of a file. Each line of this file is
  109. taken to be an include pattern</td>
  110. <td valign="top" align="center">No</td>
  111. </tr>
  112. <tr>
  113. <td valign="top">excludes</td>
  114. <td valign="top">comma- or space-separated list of patterns of files that must be
  115. excluded. No files (except default excludes) are excluded when omitted.</td>
  116. <td valign="top" align="center">No</td>
  117. </tr>
  118. <tr>
  119. <td valign="top">excludesfile</td>
  120. <td valign="top">the name of a file. Each line of this file is
  121. taken to be an exclude pattern</td>
  122. <td valign="top" align="center">No</td>
  123. </tr>
  124. <tr>
  125. <td valign="top">defaultexcludes</td>
  126. <td valign="top">indicates whether default excludes should be used or not
  127. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  128. <td valign="top" align="center">No</td>
  129. </tr>
  130. <tr>
  131. <td valign="top">verify</td>
  132. <td valign="top">check that classes implement Remote before handing them
  133. to rmic (default is false)</td>
  134. <td align="center" valign="top">No</td>
  135. </tr>
  136. <tr>
  137. <td valign="top">iiop</td>
  138. <td valign="top">indicates that portable (RMI/IIOP) stubs should be generated</td>
  139. <td align="center" valign="top">No</td>
  140. </tr>
  141. <tr>
  142. <td valign="top">iiopopts</td>
  143. <td valign="top">additional arguments for IIOP class generation</td>
  144. <td align="center" valign="top">No</td>
  145. </tr>
  146. <tr>
  147. <td valign="top">idl</td>
  148. <td valign="top">indicates that IDL output files should be generated</td>
  149. <td align="center" valign="top">No</td>
  150. </tr>
  151. <tr>
  152. <td valign="top">idlopts</td>
  153. <td valign="top">additional arguments for IDL file generation</td>
  154. <td align="center" valign="top">No</td>
  155. </tr>
  156. <tr>
  157. <td valign="top">debug</td>
  158. <td valign="top">generate debug info (passes -g to rmic). Defaults to false.</td>
  159. <td align="center" valign="top">No</td>
  160. </tr>
  161. <tr>
  162. <td valign="top">includeAntRuntime</td>
  163. <td valign="top">whether to include the Ant run-time libraries;
  164. defaults to <code>yes</code>.</td>
  165. <td align="center" valign="top">No</td>
  166. </tr>
  167. <tr>
  168. <td valign="top">includeJavaRuntime</td>
  169. <td valign="top">whether to include the default run-time
  170. libraries from the executing VM; defaults to <code>no</code>.</td>
  171. <td align="center" valign="top">No</td>
  172. </tr>
  173. <tr>
  174. <td valign="top">extdirs</td>
  175. <td valign="top">location of installed extensions.</td>
  176. <td align="center" valign="top">No</td>
  177. </tr>
  178. <tr>
  179. <td valign="top">compiler</td>
  180. <td valign="top">The compiler implementation to use.
  181. If this attribute is not set, the value of the
  182. <code>build.rmic</code> property, if set, will be used.
  183. Otherwise, the default compiler for the current VM will be used.
  184. (See the above <a href="#compilervalues">list</a> of valid
  185. compilers.)</td>
  186. <td align="center" valign="top">No</td>
  187. </tr>
  188. </table>
  189. <h3>Parameters specified as nested elements</h3>
  190. <h4>classpath and extdirs</h4>
  191. <p><code>Rmic</code>'s <i>classpath</i> and <i>extdirs</i> attributes are <a
  192. href="../using.html#path">PATH like structure</a> and can also be set via a nested
  193. <i>classpath</i> and <i>extdirs</i> elements.</p>
  194. <h4>compilerarg</h4>
  195. <p>You can specify additional command line arguments for the compiler
  196. with nested <code>&lt;compilerarg&gt;</code> elements. These elements
  197. are specified like <a href="../using.html#arg">Command-line
  198. Arguments</a> but have an additional attribute that can be used to
  199. enable arguments only if a given compiler implementation will be
  200. used.</p>
  201. <table border="1" cellpadding="2" cellspacing="0">
  202. <tr>
  203. <td width="12%" valign="top"><b>Attribute</b></td>
  204. <td width="78%" valign="top"><b>Description</b></td>
  205. <td width="10%" valign="top"><b>Required</b></td>
  206. </tr>
  207. <tr>
  208. <td valign="top">value</td>
  209. <td align="center" rowspan="4">See
  210. <a href="../using.html#arg">Command-line Arguments</a>.</td>
  211. <td align="center" rowspan="4">Exactly one of these.</td>
  212. </tr>
  213. <tr>
  214. <td valign="top">line</td>
  215. </tr>
  216. <tr>
  217. <td valign="top">file</td>
  218. </tr>
  219. <tr>
  220. <td valign="top">path</td>
  221. </tr>
  222. <tr>
  223. <td valign="top">compiler</td>
  224. <td>Only pass the specified argument if the chosen
  225. compiler implementation matches the value of this attribute.
  226. Legal values are the
  227. same as those in the above <a href="#compilervalues">list</a> of valid
  228. compilers.)</td>
  229. <td align="center">No</td>
  230. </tr>
  231. </table>
  232. <h3>Examples</h3>
  233. <pre> &lt;rmic classname=&quot;com.xyz.FooBar&quot; base=&quot;${build}/classes&quot;/&gt;</pre>
  234. <p>runs the rmic compiler for the class <code>com.xyz.FooBar</code>. The
  235. compiled files will be stored in the directory <code>${build}/classes</code>.</p>
  236. <pre> &lt;rmic base=&quot;${build}/classes&quot; includes=&quot;**/Remote*.class&quot;/&gt;</pre>
  237. <p>runs the rmic compiler for all classes with <code>.class</code>
  238. files below <code>${build}/classes</code> whose classname starts with
  239. <i>Remote</i>. The compiled files will be stored in the directory
  240. <code>${build}/classes</code>.</p>
  241. <hr>
  242. <p align="center">Copyright &copy; 2000-2006 The Apache Software Foundation. All rights
  243. Reserved.</p>
  244. </body>
  245. </html>