|
Ant requires a couple of things to run: Java source files (obviously), and a buildfile.
First we're going to create a really simple Java program for Ant to build. Grab the source here. Don't try to compile it yet, we're gonna let Ant do that. The next thing we need is the build file. You can grab that here. Make sure that you saved the build.xml file in the same directory as the Java source file. We're not going to get into what the buildfile is actually doing yet, so just trust me... Now, in your command window, cd to the directory where the Java source and the buildfile are saved (alot of tutorials leave this step out, strangely enough) and type "ant". Hopefully you will see the BUILD SUCCESSFUL message at the bottom. Now check out the directory. You'll notice that there are two new directories: "build", and "dist". These directories were built by Ant. The "build" directory will include the compiled Java class file(s) and the "dist" directory will contain a .jar file with our project name and a timestamp. |
| http://jakarta.apache.org/ant/manual/index.html |