To create a new Ant build file for an AspectJ project:
<?xml version="1.0" encoding="UTF-8"?>
<project name="My Project" default="build" basedir=".">
<target name="init">
<path id="ajde.classpath">
<pathelement path="../../plugins/org.eclipse.core.resources_3.2.1.R32x_v20060914.jar"/>
<pathelement path="../../plugins/org.eclipse.core.runtime.compatibility_3.1.100.v20060603.jar"/>
<pathelement path="../../plugins/org.eclipse.core.runtime_3.2.0.v20060603.jar"/>
<pathelement path="../../plugins/org.eclipse.osgi_3.2.1.R32x_v20060919.jar"/>
<pathelement path="../../plugins/org.eclipse.equinox.common_3.2.0.v20060603.jar"/>
<pathelement path="../../plugins/org.eclipse.core.jobs_3.2.0.v20060603.jar"/>
<pathelement path="../../plugins/org.eclipse.equinox.registry_3.2.1.R32x_v20060814.jar"/>
<pathelement path="../../plugins/org.eclipse.equinox.preferences_3.2.1.R32x_v20060717.jar"/>
<pathelement path="../../plugins/org.eclipse.core.contenttype_3.2.0.v20060603.jar"/>
<pathelement path="../../plugins/org.eclipse.core.runtime.compatibility.auth_3.2.0.v20060601.jar"/>
<pathelement path="../../plugins/org.eclipse.update.configurator_3.2.1.v20092006.jar"/>
<pathelement path="../../plugins/org.eclipse.ant.core_3.1.100.v20060531.jar"/>
<pathelement path="../../plugins/org.eclipse.core.variables_3.1.100.v20060605.jar"/>
<pathelement path="../../plugins/org.eclipse.core.expressions_3.2.1.r321_v20060721.jar"/>
<pathelement path="../../plugins/org.eclipse.core.filesystem_1.0.0.v20060603.jar"/>
<pathelement path="../../plugins/org.eclipse.text_3.2.0.v20060605-1400.jar"/>
<pathelement path="../../plugins/org.eclipse.core.commands_3.2.0.I20060605-1400.jar"/>
<pathelement path="../../plugins/org.aspectj.ajde_1.5.3.200610201049/ajde.jar"/>
<pathelement path="../../plugins/org.aspectj.weaver_1.5.3.200610201049/aspectjweaver.jar"/>
<pathelement path="../../plugins/org.aspectj.runtime_1.5.3.200610201049/aspectjrt.jar"/>
</path>
<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
<classpath refid="ajde.classpath" />
</taskdef>
</target>
<target name="build" depends="init">
<delete dir="${basedir}/bin"/>
<mkdir dir="${basedir}/bin"/>
<path id="user.classpath">
<!-- add additional classpath entries here -->
</path>
<!-- read additional ajc options from a file if required -->
<property name="ajcArgFile" value=""/>
<!-- fork the compiler -->
<iajc destDir="${basedir}/bin" failonerror="true" argfiles="${ajcArgFile}"
verbose="true" fork="true" maxmem="512m">
<forkclasspath refid="ajde.classpath" />
<forkclasspath refid="user.classpath" />
<src path="src/"/>
</iajc>
</target>
</project>
Please see the AspectJ language guide for more information on the iajc Ant task.