123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410 |
- <!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>AjcTask Ant Support for AspectJ 1.1</title>
- </head>
- <body>
-
- <h2>
- <a NAME="ajc"></a>AjcTask Ant Support for AspectJ 1.1</h2>
-
- <h3>
- Description</h3>
-
- This task uses the AspectJ<small><sup>tm</sup></small> 1.1 compiler
- <code>ajc</code>.
-
- The AspectJ compiler can be used like
- <a href="http://jakarta.apache.org/ant/manual/CoreTasks/javac.html">Javac</a>
- to compile Java sources, but it can also compile AspectJ sources or
- weave binary aspects with Java bytecode. It can run in normal "batch" mode
- or in an "incremental" mode, where it only recompiles files it has to revisit.
- For more information on <tt>ajc</tt>, see the links from
- the <a href="index.html">AspectJ docs home</a>. The main things to remember:
- <ul>
- <li>In incremental mode, sources may only be specified using source root directories.
- </li>
- <li>A .class file may only be woven once. That means
- binaries in injars or aspectjpath must have been compiled with jikes or javac
- or, if using ajc, with noweave.
- </li>
- </ul>
- This task is named <tt>iajc</tt> now to avoid conflict with the
- 1.0 task <tt>ajc</tt>, but the name may change to <tt>ajc</tt> in
- the future.
- <p>
- See <a href="#compilerMessages">below</a> for
- an introduction to handling compiler messages programmatically.
-
- <p>
- <h3>
- Parameters</h3>
-
- <p>
- <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>
- <th colspan="3">Specifying source and destination files</th>
- </tr>
-
- <td VALIGN=TOP>sourceRoots</td>
-
- <td VALIGN=TOP>Base directory of the source files.
- All source files (.java and .aj) in the base directories are compiled.
- May also be specified as a <a href="nestedElements">nested element</a>.
- </td>
- <td rowspan="2" ALIGN=CENTER VALIGN=TOP>Yes, in incremental mode.</td>
- </tr>
-
- <td VALIGN=TOP>sourceRootsList</td>
-
- <td VALIGN=TOP>Comma-delimited list of base directories source root
- directories.
- May also be specified as a <a href="nestedElements">nested element</a>.
- </td>
-
- </tr>
-
- <tr>
- <td VALIGN=TOP>outjar</td>
- <td VALIGN=TOP>Path to an output jar to generate with all output classes.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </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>classpath</td>
- <td VALIGN=TOP>The classpath required by the source files to compile.
- May also be specified as a <a href="nestedElements">nested element</a>.
- </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>srcdir</td>
- <td VALIGN=TOP>The nested source base directory to compile,
- specified as a <a href="nestedElements">nested element</a>.
- </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>aspectpath</td>
- <td VALIGN=TOP>The aspectpath to use -- like classpath, only for
- read-only, binary aspect libraries (only accepts jar/zip files, no directories).
- May also be specified as a <a href="nestedElements">nested element</a>.
- </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>
- <th colspan="3">Specifying compiler behavior</th>
- </tr>
-
- <tr>
- <td VALIGN=TOP>noweave</td>
- <td VALIGN=TOP>If true, produce binaries for the -injars option (only) --
- defaults to <tt>false</tt>.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>incremental</td>
- <td VALIGN=TOP>Build once, then recompile on demand only required files;
- defaults to <tt>false</tt>.
- By default, files are recompiled based on input passed to stdin
- (see tagfile)</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>tagfile</td>
- <td VALIGN=TOP>File that controls when incremental builds are done
- and when the task completes.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>X</td>
- <td VALIGN=TOP>Set experimental option(s), using comma-separated list
- of accepted options (unlisted here -- for XLint, use
- the xlint entries). Options should not contain the leading X.</td> <!-- XXX list -->
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
-
- <tr>
- <th colspan="3">Specifying compiler side-effects and messages</th>
- </tr>
-
- <tr>
- <td VALIGN=TOP>emacssym</td>
- <td VALIGN=TOP>Whether to emit <tt>.ajesym</tt> symbol files for Emacs support;
- 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 compile;
- defaults to <tt>false</tt>.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>version</td>
- <td VALIGN=TOP>If true, do not compile - just print AspectJ version;
- defaults to <tt>false</tt>.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>help</td>
- <td VALIGN=TOP>If true, just print help for the command-line compiler;
- defaults to <tt>false</tt>.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>Xlintwarnings</td>
- <td VALIGN=TOP>Same as <tt>xlint:warning</tt> -
- if enabled, set default level of all language usage messages to warning;
- defaults to <tt>false</tt>.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>Xlint</td>
- <td VALIGN=TOP>Specify default level of all language usage messages
- to one of (error, warning, ignore).
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>Xlintfile</td>
- <td VALIGN=TOP>Specify property file containing name:level
- associations setting level for language messages emitted
- during compilation. Any levels set override the default
- associations in
- <code>org/aspectj/weaver/XLintDefault.properties</code>.
- </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>messageholderclass</td>
- <td VALIGN=TOP>Specify a class to use as the message holder for the compile
- process. The entry must be a fully-qualified name of a class resolveable
- from the task classpath complying with the <tt>org.aspectj.bridge.IMessageHolder</tt>
- interface and having a public no-argument constructor.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
-
- <tr>
- <th colspan="3">Eclipse compiler options</th>
- </tr>
-
- <tr>
- <td VALIGN=TOP>nowarn</td>
- <td VALIGN=TOP>Same as <tt>warn:none</tt>;
- defaults to <tt>false</tt>. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>deprecation</td>
- <td VALIGN=TOP>Same as <tt>warn:deprecation</tt>;
- defaults to <tt>false</tt>. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>warn</td>
- <td VALIGN=TOP>One or more comma-separated warning specifications:
- <tt>constructorName</tt>,
- <tt>packageDefaultMethod</tt>,
- <tt>deprecation</tt>,
- <tt>maskedCatchBlocks</tt>,
- <tt>unusedLocals</tt>,
- <tt>unusedArguments</tt>,
- <tt>unusedImports</tt>,
- <tt>syntheticAccess</tt>, or
- <tt>assertIdentifier</tt>.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>debug</td>
- <td VALIGN=TOP>Same as <tt>debug:lines,vars,source</tt></td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>debuglevel</td>
- <td VALIGN=TOP>One or more comma-separated debug specifications:
- <tt>lines</tt>,
- <tt>vars</tt>, or
- <tt>source</tt>.
- </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>PreserveAllLocals</td>
- <td VALIGN=TOP>Code gen preserves all local variables (for debug purposes);
- defaults to <tt>false</tt>. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>noimporterror</td>
- <td VALIGN=TOP>No errors for unresolved imports;
- defaults to <tt>false</tt>. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>referenceinfo</td>
- <td VALIGN=TOP>Compute reference info;
- defaults to <tt>false</tt>. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>log</td>
- <td VALIGN=TOP>File to log compiler messages to.</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>encoding</td>
- <td VALIGN=TOP>Default source encoding format</td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>proceedonerror</td>
- <td VALIGN=TOP>Keep compiling when error, dumping class files with problem methods;
- defaults to <tt>false</tt>. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>progress</td>
- <td VALIGN=TOP>Show progress (requires log);
- defaults to <tt>false</tt>. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>time</td>
- <td VALIGN=TOP>Display speed information;
- defaults to <tt>false</tt>. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <!--
- <tr>
- <td VALIGN=TOP>noexit</td>
- <td VALIGN=TOP>Disable System.exit; defaults to <tt>true</tt>.
- (<em>If false, this kills the Ant process</em>;
- to halt compile gracefully, use <tt>failonerror</tt>);
- </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
- -->
- <tr>
- <td VALIGN=TOP>target</td>
- <td VALIGN=TOP>Specify target class file format (must be "1.1" or "1.2");
- defaults to 1.1 class file. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>compliance</td>
- <td VALIGN=TOP>Set "1.3" or "1.4" source compliance level
- (e.g., no import from default package in 1.4);
- defaults to 1.3 compliance level. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- <tr>
- <td VALIGN=TOP>source</td>
- <td VALIGN=TOP>Source assertion mode ("1.3" or "1.4");
- default depends on compliance mode. </td>
- <td ALIGN=CENTER VALIGN=TOP>No</td>
- </tr>
-
- </table>
-
- <a name="nestedElements"></a>
- <h3>Nested Elements</h3>
- This taskdef should support nested elements as the old one did;
- see <a href="taskdef-ajc10.html#nestedElements">taskdef-ajc10.html#nestedElements</a>.
-
- <a name="compilerMessages"></>
- <h3>Programmatically handling compiler messages</h3>
-
- Users may specify a message holder which is passed all
- messages generated by the compiler synchronously. This overrides all of the normal
- message printing, but does not prevent the task from failing if failonerror is true
- and errors or exceptions were encountered.
-
- Handling messages programmatically could be useful
- when using the compiler to inspect code.
- If aspects consist of declare [error|warning], then
- the compiler can act to detect invariants in the code being processed.
- For code to compare expected and actual messages, see the AspectJ
- testing module (which is not included in the binary distribution).
-
-
- <hr>
- <center>
- </center>
-
- </body>
- </html>
|