| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <title> |
| Creating a new Ant build file |
| </title> |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| </head> |
| <body> |
| <h1> |
| Creating a new Ant build file |
| </h1> |
| <p> |
| To create a new Ant build file for an AspectJ project: |
| </p> |
| <ol> |
| <li> |
| Either from the context menu or from the menu bar's <strong>File</strong> menu, select <strong>New > File</strong>. |
| </li> |
| <li> |
| Call the file <em>build.xml</em>. |
| </li> |
| <li> |
| Double click on the file to open in the Ant editor. |
| </li> |
| <li> |
| Edit the file as below: |
| |
| <p><code><br> |
| <?xml version="1.0" encoding="UTF-8"?><br><br> |
| <project name="My Project" default="build" basedir="."><br><br> |
| |
| <target name="init"><br> |
| <path id="ajde.classpath"><br> |
| <pathelement path="../../plugins/org.eclipse.core.resources_3.2.1.R32x_v20060914.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.core.runtime.compatibility_3.1.100.v20060603.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.core.runtime_3.2.0.v20060603.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.osgi_3.2.1.R32x_v20060919.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.equinox.common_3.2.0.v20060603.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.core.jobs_3.2.0.v20060603.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.equinox.registry_3.2.1.R32x_v20060814.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.equinox.preferences_3.2.1.R32x_v20060717.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.core.contenttype_3.2.0.v20060603.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.core.runtime.compatibility.auth_3.2.0.v20060601.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.update.configurator_3.2.1.v20092006.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.ant.core_3.1.100.v20060531.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.core.variables_3.1.100.v20060605.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.core.expressions_3.2.1.r321_v20060721.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.core.filesystem_1.0.0.v20060603.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.text_3.2.0.v20060605-1400.jar"/><br> |
| <pathelement path="../../plugins/org.eclipse.core.commands_3.2.0.I20060605-1400.jar"/><br> |
| <pathelement path="../../plugins/org.aspectj.ajde_1.5.3.200610201049/ajde.jar"/><br> |
| <pathelement path="../../plugins/org.aspectj.weaver_1.5.3.200610201049/aspectjweaver.jar"/><br> |
| <pathelement path="../../plugins/org.aspectj.runtime_1.5.3.200610201049/aspectjrt.jar"/><br> |
| </path><br> |
| <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"><br> |
| <classpath refid="ajde.classpath" /><br> |
| </taskdef><br> |
| </target><br><br> |
| |
| <target name="build" depends="init"><br> |
| <delete dir="${basedir}/bin"/><br> |
| <mkdir dir="${basedir}/bin"/><br> |
| <path id="user.classpath"><br> |
| <!-- add additional classpath entries here --><br> |
| </path><br> |
| <!-- read additional ajc options from a file if required --><br> |
| <property name="ajcArgFile" value=""/><br> |
| <!-- fork the compiler --><br> |
| <iajc destDir="${basedir}/bin" failonerror="true" argfiles="${ajcArgFile}"<br> |
| verbose="true" fork="true" maxmem="512m"><br> |
| <forkclasspath refid="ajde.classpath" /><br> |
| <forkclasspath refid="user.classpath" /><br> |
| <src path="src/"/><br> |
| </iajc><br> |
| </target><br><br> |
| </project> <br><br> |
| </code> |
| </p> |
| </li> |
| <li> |
| <strong>Note: </strong>The path to the 'plugins' directory may be different on your machine and you may need |
| to add other paths to the classpath. Update these to reflect the correct values for your environment. You |
| will also need to change the version numbers as appropriate. |
| </li> |
| </ol> |
| <p> |
| Please see the AspectJ language guide for more information on the iajc Ant task. |
| </p> |
| |
| <p> |
| <img src="../images/ngrelt.gif" alt="Related tasks" border="0" height="27" width="159"> |
| </p> |
| <p> |
| <a href="newpluginbuildfile.htm">Creating an Ant build file for an AspectJ plug-in</a> |
| </p> |
| |
| </body> |
| </html> |
| |