The following build.xml file has a few targets that make compiling a project much simplier. Read on for more details.
I have the following directory structure:
(chris@hobbes)-(BackupLink)$ ls -l
total 20
drwxrwxr-x 3 chris chris 4096 Apr 21 00:07 bin
-rw-rw-r-- 1 chris chris 2776 Apr 21 00:15 Build.xml
drwxrwxr-x 2 chris chris 4096 Apr 13 19:07 CVS
drwxrwxr-x 2 chris chris 4096 Apr 20 14:32 include
drwxrwxr-x 4 chris chris 4096 Apr 21 00:06 src
In Eclipse, I set the project preference to make [project root]/src the only folder on the source path. Lastly, I set bin to be the output folder. The ant script grabs any jars out of include (mostly useless to me).
When I want to create a jar, I just run the jar target. I removes the java source files before creating the jar archive. You can also increment the version number to create ‘releases’. This is the best I can come up with right now.