blob: ef29067c2b1ace8f7fb55a884c6a3f12ae146835 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<title>Ant buildfiles as project builders</title>
</HEAD>
<BODY BGCOLOR="#ffffff">
<h3>Ant buildfiles as project builders</h3>
<P CLASS="Para">Our second practical example of using Ant buildfiles in Eclipse
is a 'project builder'. This is an Ant buildfile that has been designated to
run whenever a project is built. The uses for such a buildfile are many:</P>
<ul>
<li>Generate a .jar file containing class files from your project</li>
<li>Perform some type of pre or post build processing on source or binary files
in your project. For example:
<ul>
<li>Pre-processing source files to instrument them for performance analysis</li>
<li>Obfuscating binary files to prevent reverse engineering</li>
</ul>
</li>
<li>Copy class files to some location (for instance, on a network)</li>
</ul>
<p>For this example, we will create an Ant buildfile that creates a .jar archive
of the class files in a project. Note that this is similar to the example in
the last chapter, in which we used an Ant buildfile to generate .jar files for
an Eclipse plug-in. This example differs in that it works for any Eclipse project,
whether or not it is also an Eclipse plug-in. </p>
</BODY>
</HTML>