All of my past experience with ant has been with somebody else making the scripts and we always used it to "build" (not "make"). If I have large app that includes a swing gui, jsp's, servlets, ejb's, etc. would I be able to create an ant script that can do a sort of make? As in, if I tweak a JSP, could I call ant with no parms and it would just re-build the war file without re-compiling any java or re-building any EJB's? And if I do tweak an EJB and call ant with no parms, would it recompile/rebuild just the one EJB? To do that, would I have to tell ant about every EJB?
The short answer is, what you're describing, Ant can do. Check out the Ant scripts in the Java Pet Store reference application. They use Ant for everything, from compiling, to jarring, to deploying. And that'll cover servlets, EJBs, JSPs, a Swing GUI, etc.
Originally posted by Paul Wheaton: Will I have to tell the ant build.xml file about every bean to keep it from processing all beans if I change just one?
What Application Server are you using? Ant's optional libraries have some nice tags for building to specific App Servers. For example, there is a tag for WebLogic that will build your ejb jar and then run ejbc on it. If the class files have not changed since the last build then the ejb jar will not be rebuilt. I definitely suggest you look into this. Here is a link: ejbjar Task Documentation. [ January 14, 2003: Message edited by: Chris Mathews ]
You have to tell build.xml how to build each jar file, of course. That is, you have to tell Ant what files to jar up. If you change a single source file, then only the jar (or jars) that depend on it will be rebuilt. I'm not clear on the distinction you're drawing between "make" and "build".
By that definition, Ant is definitely a make tool. (This is true as long as you follow Ant's rules so that it can determine if a file has been changed.) [ January 14, 2003: Message edited by: Thomas Paul ]