eclipsejarantjavac

How can I automate compiling a large Java project?


I'm working on an automation project for my employer. We have a pool for each revision of our source code. When you download a revision, you need to create a directory structure with a bunch of third party includes to eventually build the project. I've automated this entire process up to the point of having my script (.bat) compile each particular runnable java application. There are many applications to this single project, and the directory listing looks something like this:

Proj Name
   -variousincludesfolder1
   -variousincludesfolder2
   -variousincludesfolder3
   -variousincludesfolder4
   -runnableapplicationsandmoreincludes
       -con.java

Right now, I'd like to do an automated compiling of con.java, but I don't know where to begin. People have suggested I try Ant, but any automated Ant file generation I get using Eclipse seems only enough to build con.java while an active project file exists. Is there anyway to automate this without using eclipse, to the point of having the batch file generate a .jar itself?


Solution

  • This is definitely a job for Ant. Don't rely on Eclipse-generated Ant files; read through the manual and write one yourself. (You'll likely find out that Ant does things you didn't think of doing in your build script, too.)

    To be more specific, here is the documentation for the jar task.