<h2>
<a NAME="ajc"></a>AjcTask Ant Support for AspectJ 1.1</h2>
+<small><a href="ant-tasks.html">AspectJ Ant Tasks</a></small>
<h3>
Description</h3>
<td VALIGN=TOP>aspectpath, aspectpathref
<br>(<a href="#nestedElements">Path</a>)
</td>
-<td VALIGN=TOP>The aspectpath to use -- like classpath, only for
-read-only, binary aspect libraries (only accepts jar/zip files, no directories).
+<td VALIGN=TOP>Similar to classpath, aspectpath contains
+read-only, binary aspect libraries; unlike classpath,
+it only accepts jar/zip files, not directories.
</td>
<td ALIGN=CENTER VALIGN=TOP>No</td>
</tr>
Examples</h3>
See <a href="examples/build.xml">examples/build.xml</a>
-for an example build script.
+for an example build script and
+<a href="ant-tasks.html">ant-tasks.html</a>
+for introductory scripts.
<a name="compilerMessages"></>
<h3>Programmatically handling compiler messages</h3>
Included in the <tt>aspectjtools.jar</tt> are Ant binaries to support
three ways of running the compiler:
<ol>
-<li><tt>Ajc10</tt> (<a href="ant-ajc10-task.html">options</a>),
+<li><tt>Ajc10</tt> (<a href="ant-ajc10-task.html">parameters</a>),
a task to run build scripts compatible with the AspectJ 1.0 tasks,</li>
-<li><tt>AjcTask</tt> (<a href="ant-ajc-task.html">options</a>),
+<li><tt>AjcTask</tt> (<a href="ant-ajc-task.html">parameters</a>),
a task to run the new AspectJ 1.1 compiler, which supports
all the eclipse and ajc options, including incremental mode;
<li><tt>Ajc11CompilerAdapter</tt>,
on integrating user-defined Ant tasks into builds.</p></li>
<p>
-<h3><a name="#ajc10">Ajc10 (script name: ajc)</a></h3>
+<h3><a name="#ajc10">Ajc10 (script name: ajc)
+<small><a href="ant-ajc10-task.html">parameters</a></small>
+</a></h3>
This task handles the same arguments as those used by the AspectJ 1.0 task.
This should permit those with existing build scripts using
the Ajc Ant task to continue using the same scripts
</project>
</pre>
-<h3><a name="#ajctask">AjcTask (script name: iajc)</a></h3>
-This task handles all the ajc 1.1 compiler options,
-as well as an incremental "tag" file to avoid depending
-on Ant input/output for controlling Ant-based incremenal compilation.
-
-<p>Below is an example of incrementally compiling <tt>src</tt>
- and <tt>testsrc</tt> root source directories, using <tt>tagfile.txt</tt>
- to control recompilation and halting.
-When this script is run, the compiler will build once and
-then wait for incremental builds, recompiling each time the
-last-modified date changes on the tag file. When the tag file no longer
-exists, the build will complete. Messages are printed as usual.
+<h3><a name="#ajctask">AjcTask (script name: iajc)
+<small><a href="ant-ajc-task.html">parameters</a></small>
+</a></h3>
+This task handles all the ajc 1.1 compiler options, including
+the experimental option for an incremental "tag" file.
+It also can copy resources from source directories or input jars
+to the output jar or directory.
+
+<p>A minimal build script defines the task
+and runs it, specifying the sources:
+
<pre>
-<project name="incremental-example" default="compile" >
+<project name="simple-example" default="compile" >
<taskdef
resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
<classpath>
</taskdef>
<target name="compile" >
- <mkdir dir="dest" />
- <iajc destdir="dest"
- tagfile="tagfile.txt"
- sourceroots="src${path.separator}testsrc" >
- <!-- declare classes needed to compile the target files -->
+ <iajc sourceroots="${home.dir}/ec/project/src" />
+ </target>
+</project>
+</pre>
+
+
+<p>Below is script with most everything in it.
+The compile process...
+<ul>
+<li>Runs in incremental mode, recompiling when the user
+ hits return;
+ </li>
+<li>Reads all the sources from two directories;
+ </li>
+<li>Reads extrinsic module bytecode as input jar for weaving;
+ </li>
+<li>Uses a binary aspect library for persistence;
+ </li>
+<li>Outputs to an application jar; and
+ </li>
+<li>Copies resources from the input jar and source directories
+ into the application jar.
+ </li>
+</ul>
+
+When this target is built, the compiler will build once and
+then wait for input from the user.
+Messages are printed as usual.
+When the user has quit, then this runs the application.
+<pre>
+
+ <target name="build-test" >
+ <iajc outjar="${home.dir}/output/application.jar"
+ injars="${home.dir}/build/module.jar"
+ copyInjars="true"
+ sourceRootCopyFilter="**/CVS/*,**/*.java"
+ incremental="true" >
+ <sourceroots>
+ <pathelement location="${home.dir}/ec/project/src"/>
+ <pathelement location="${home.dir}/ec/project/testsrc"/>
+ </sourceroots>
+ <aspectpath>
+ <pathelement location="${home.dir}/ec/int/persist.jar"/>
+ </aspectpath>
<classpath>
<pathelement location="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>
</classpath>
</iajc>
+
+ <java classname="org.smart.app.Main">
+ <classpath>
+ <pathelement location="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>
+ <pathelement location="${home.dir}/ec/int/persist.jar"/>
+ <pathelement location="${home.dir}/output/application.jar"/>
+ </classpath>
+ </java>
</target>
-</project>
</pre>
the variable they use in their scripts to pass VM options, e.g., ANT_OPTS=-Xmx128m).
</li>
-<li><u>Messages suppressed</u>: In the incremental task,
-messages from the compiler are printed but not segregated.
-</li>
-
<p>
You can send email to <a href="mailto:aspectj-users@dev.eclipse.org">
mailto:aspectj-users@dev.eclipse.org</a>.