blob: c07634ccaa6146261a6afa8621cbec0e130cb61d [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
Using build configurations with Ant
</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>
Using build configurations with Ant
</h1>
<p>
The format used in .ajproperties files is that of standard properties files.
If want to build your Eclipse projects using Ant, you can either convert your
.ajproperties files to the old .lst format, or you can process the .ajproperties
files directly. Below is a snippet from an example build.xml file which reads the
src.includes and src.excludes properties from a .ajproperties file and passes them to the
iajc Ant task.</p>
<p><code><br>
&nbsp;&nbsp; &lt;property file="tracelib.ajproperties"/&gt;<br><br>
&nbsp;&nbsp; &lt;target name="compile" &gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;iajc srcdir="."<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; includes="${src.includes}" excludes="${src.excludes}" <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fork="true"/&gt;<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;forkclasspath&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;pathelement .../&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br><br>
&nbsp;&nbsp; &lt;/target&gt;<br><br>
</code>
</p>
<p>
Note that there is a limitation here in that Ant processes the includes
and excludes in a slightly different way to Eclipse. For example if you
include “lib/AbstractTracing.java” but exclude “lib/” then as a build
configuration in Eclipse, the source file will be an included entry in an
otherwise excluded package. Ant processes the includes first, then removes
the matching excludes, so everything under “lib/” will be excluded
(thus overriding the include entry).
</p>
</p>
<p>
<img src="../images/ngrelc.gif" alt="Related concepts" border="0" height="27" width="159"> <br>
<a href="../concepts/projects.htm">AspectJ projects</a><br>
<a href="../concepts/buildconfigs.htm">Build configurations</a>
</p>
<p>
<img src="../images/ngrelt.gif" alt="Related tasks" border="0" height="27" width="159">
</p>
<p>
<a href="newantfile.htm">Creating a new Ant build file</a><br>
<a href="newpluginbuildfile.htm">Creating an Ant build file for an AspectJ plug-in</a><br>
<a href="newbuildconfig.htm">Creating a new build configuration</a><br>
<a href="editbuildconfig.htm">Editing a build configuration</a><br>
<a href="switchbuildconfig.htm">Switching build configurations</a><br>
<a href="lstfiles.htm">.lst file support</a>
</p>
<p>
<a href="../notices.html"><img src="../cpy.gif" border="0" alt="Legal notices" width="324" height="14"></a>
</p>
</body>
</html>