source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual/manual/CoreTasks/rmic.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

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