1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-us">
<title>Ajc10 Ant Task</title>
</head>
<body>
<h2>
<a NAME="ajc10"></a>Ajc10 Ant Task</h2>
<h3>
Description</h3>
This task is provided for backwards compatibility with build scripts
created for the AspectJ 1.0 <tt>ajc</tt> task. Developers using only
AspectJ 1.1 should upgrade their scripts to use the newer task.
This task is deprecated and may not be supported in the future.
Options no longer supported in 1.1 are still accepted, but have
no effect, other than to be listed in a warning emitted by the task.
<p>
This task compiles using the AspectJ<small><sup>tm</sup></small> compiler <code>ajc</code>;
you can use it in place of the
<a href="http://jakarta.apache.org/ant/manual/CoreTasks/javac.html">Javac</a> task.
The interface is like the <tt>Javac</tt> task interface, except it also accepts
<a href="#ajc-parameters">parameters unique to <code>ajc</code></a>.
Of these, most no longer have any effect (nocomments, preprocess, workingdir,
maxmemory, jvmarg), but argfiles are still supported. (For more information
on argfiles, see <a href="#argfiles">below</a>.)
<p>
<h3>
Parameters</h3>
<h4>Parameters supported by <code>ajc</code></h4>
<table BORDER CELLSPACING=0 CELLPADDING=2 >
<tr>
<td VALIGN=TOP><b>Attribute</b></td>
<td VALIGN=TOP><b>Description</b></td>
<td ALIGN=CENTER VALIGN=TOP><b>Required</b></td>
</tr>
<tr>
<td VALIGN=TOP>srcdir</td>
<td VALIGN=TOP>the base directory of the java files. (See <a href="#nestedElements">note</a>)</td>
<td ALIGN=CENTER VALIGN=TOP>Yes, unless you use <tt>argfile</tt>
or nested <tt><src></tt> elements.
</tr>
<tr>
<td VALIGN=TOP>destdir</td>
<td VALIGN=TOP>Specify where to place the generated class files.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>includes</td>
<td VALIGN=TOP>comma-separated list of patterns of files that must be included;
<b>no</b>
files are included when omitted.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>includesfile</td>
<td VALIGN=TOP>the name of a file that contains include patterns.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>excludes</td>
<td VALIGN=TOP>comma-separated list of patterns of files that must be excluded;
no files (except default excludes) are excluded when omitted.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>excludesfile</td>
<td VALIGN=TOP>the name of a file that contains exclude patterns.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>defaultexcludes</td>
<td VALIGN=TOP>whether default excludes should be used (<tt>yes</tt>
| <tt>no</tt>); default excludes are used when omitted.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>classpath</td>
<td VALIGN=TOP>the classpath to use.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>bootclasspath</td>
<td VALIGN=TOP>location of bootstrap class files.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>classpathref</td>
<td VALIGN=TOP>the classpath to use, given as a<a href="http://jakarta.apache.org/ant/manual/using.html#references">
reference</a> to a PATH defined elsewhere.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>bootclasspathref</td>
<td VALIGN=TOP>location of bootstrap class files, given as a <a href="http://jakarta.apache.org/ant/manual/using.html#references">reference</a>
to a PATH defined elsewhere.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>extdirs</td>
<td VALIGN=TOP>location of installed extensions </td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>debug</td>
<td VALIGN=TOP>whether debug information should be included in classes output;
defaults to <tt>false</tt>.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>deprecation</td>
<td VALIGN=TOP>whether compiler should emit messages about
usage of deprecated API; defaults to <tt>false</tt>.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>verbose</td>
<td VALIGN=TOP>whether to emit compiler status messages during the compiler;
defaults to <tt>false</tt>.</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>version</td>
<td VALIGN=TOP>print ajc version and exit</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>failonerror</td>
<td VALIGN=TOP>whether the build continues notwithstanding compile errors;
defaults to <tt>true</tt>. </td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>source</td>
<td VALIGN=TOP>Value of -source option - ignored unless "1.4"</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
</table>
<h4>
<a NAME="ajc-parameters-ignored"></a>Parameters that used to be ignored by
the <code>ajc</code> taskdef, but now are supported or cause failures</h4>
<table BORDER CELLSPACING=0 CELLPADDING=2 >
<tr>
<td VALIGN=TOP><b>Attribute</b></td>
<td VALIGN=TOP><b>Description</b></td>
<td ALIGN=CENTER VALIGN=TOP><b>Support</b></td>
</tr>
<tr>
<td VALIGN=TOP>encoding</td>
<td VALIGN=TOP>encoding of source files.</td>
<td ALIGN=CENTER VALIGN=TOP>Yes?</td>
</tr>
<tr>
<td VALIGN=TOP>optimize</td>
<td VALIGN=TOP>whether source should be compiled with optimization</td>
<td ALIGN=CENTER VALIGN=TOP>Yes?</td>
</tr>
<tr>
<td VALIGN=TOP>target</td>
<td VALIGN=TOP>generate class files for specific VM version (e.g., <tt>1.1</tt>
or <tt>1.2</tt>).</td>
<td ALIGN=CENTER VALIGN=TOP>Yes</td>
</tr>
<tr>
<td VALIGN=TOP>depend</td>
<td VALIGN=TOP>enables dependency-tracking </td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>includeAntRuntime</td>
<td VALIGN=TOP>whether to include the Ant run-time libraries</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>includeJavaRuntime</td>
<td VALIGN=TOP>whether to include the run-time libraries from the
executing VM</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>threads</td>
<td VALIGN=TOP>Multi-threaded compilation</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
</table>
<h4>
<a NAME="ajc-parameters"></a>Parameters unique to <code>ajc</code></h4>
<u>Note</u>: Many of the unique parameters in AspectJ 1.0 are no longer supported,
and fork is not supported yet.
<table BORDER CELLSPACING=0 CELLPADDING=2 >
<tr> <td VALIGN=TOP><b>Attribute</b></td>
<td VALIGN=TOP><b>Description</b></td>
<td ALIGN=CENTER VALIGN=TOP><b>Required</b></td>
</tr>
<tr>
<td VALIGN=TOP>X</td>
<td VALIGN=TOP>comma-delimited list of extended (-X...) options,
entered without -X
(e.g., <code>X="lint"</code> for
<code>-Xlint</code>). </td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>emacssym</td>
<td VALIGN=TOP>Generate symbols for Emacs IDE support
(defaults to off)</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
<tr>
<td VALIGN=TOP>argfiles</td>
<td VALIGN=TOP>a comma-delimited list of argfiles that
contain a line-delimited list of source file paths
(absolute or relative to the argfile) </td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
</table>
<a name="argfiles"></a>
<h3>argfiles - Argument list files</h3>
An argument file is a file (usually <tt><file>.lst</tt>) containing a list of source file
paths (absolute or relative to the argfile).
You can use it to specify all source files to be compiled, which <code>ajc</code> requires
to avoid searching every possible source file in the source path when building aspects.
If you specify an argfile to the <tt>ajc</tt> task, it will not include all files in any specified
source directory (which is the default behavior for the Javac task when no includes are
specified). Conversely, if you specify excludes, they will be removed from the list of
files compiled even if they were specified in an argument file.
<br>
<a name="nestedElements"></a>
<h3>
Parameters specified as nested elements</h3>
This task forms an implicit <a href="http://jakarta.apache.org/ant/manual/CoreTypes/fileset.html">FileSet</a>
and supports all attributes of <tt><fileset></tt> (<tt>dir</tt> becomes
<tt>srcdir</tt>)
as well as the nested
<tt><include></tt>, <tt><exclude></tt>,
<tt><patternset>,
and <argfile></tt> elements.
<h4>
<tt>src</tt>, <tt>classpath</tt>, <tt>bootclasspath</tt> and <tt>extdirs</tt></h4>
<tt>ajc</tt>'s <i>srcdir</i>, <i>classpath</i>,
<i>bootclasspath, extdirs</i>
and <i>jvmarg</i> attributes are <a href="http://jakarta.apache.org/ant/manual/using.html#path">path-like
structures</a> and can also be set via nested
<tt><src></tt>,
<tt><classpath></tt>,
<tt><bootclasspath>,
<extdirs> </tt>and <tt><jvmarg> </tt>elements, respectively.
<p>
<h3>
Examples</h3>
See <a href="../examples/builds.xml">../examples/builds.xml</a>
for an example build script.
<p>
This build script snippet
<pre> <ajc srcdir="${src}"
destdir="${build}"
argfiles="demo.lst"
/></pre>
compiles all <tt>.java</tt> files specified in the <tt>demo.lst</tt> and
stores the <tt>.class</tt> files in the <tt>${build}</tt> directory.
Unlike the Javac task, the
<i>includes</i> attribute is empty by default, so only those
files specified in <tt>demo.lst</tt> are included.
<p>This next example
<pre> <ajc srcdir="${src}"
destdir="${build}"
includes="spacewar/*,coordination/*"
excludes="spacewar/Debug.java"
/></pre>
compiles <tt>.java</tt> files under the <tt>${src}</tt> directory in the
<tt>spacewar
</tt>and<tt>
coordination </tt>packages, and stores the
<tt>.class</tt> files in the
<tt>${build}</tt> directory. All source files under
<tt>spacewar/</tt> and
<tt>coordination/</tt> are used, except <tt>Debug.java</tt>.
<hr>
</body>
</html>
|