This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello, I'd like to know when I should use ANT. For example, when I'm building a very small app, just 10 classes. I can do this very well with just putting javac on the commandline. Without all the trouble of creating the build.xml file. What is the real purpose for using ANT. Is it meant for large scale applications? Or is it also meant for applets, midlets and even WebApplications. And why sould I not just use the building done by the IDE I use? Regards, Mark Monster
Originally posted by M.K.A. Monster: What is the real purpose for using ANT. Is it meant for large scale applications? Or is it also meant for applets, midlets and even WebApplications.
As usual, with small projects a lot of tools become an overhead. Where the line goes there is no saying (how do you differentiate a large scale application from a small scale application anyway?). You have to list the pros and cons, take a moment and decide whether an Ant script is beneficial for your particular project. Some benefits to consider: - The build process is repeatable - The build process is centrally managed - The build process can be configured - The build script is structured better - Additional features can be added without hassle (such as automatic metrics, enforcing coding convention, automatic deployment, automatic backup, and the list goes on)
Originally posted by M.K.A. Monster: And why sould I not just use the building done by the IDE I use?
If it feels good, it is good. The question is do you need something that the IDE doesn't provide? If you don't then why change anything? The IDE features are enough for a personal project missing some "bigger picture" views such as release cycles but as these become necessary, the IDE won't flex enough. Furthermore, the next developer may not use the same IDE as you do...
I find ant useful for even very small projects. In particular I find its easy integration with JUnit, the ability to automatically create "jar" files of applications, and the way it can be used to back up my source code to another directory or zip file to make it easier to go back to old versions. If your IDE really allows you to build, test, package in a jar, produce javadoc and then run your software with just one button, it may be good enough to avoid the need for something like Ant (for now, at least). If doing all of that requires more than one button click, you should consider automating the process, and Ant is a good place to start.
I'm with Frank on this one, IDEs make life easier but none that I have found can do what ant does. I recently started using ant and I honestly wonder how I ever got along without it. There is a little bit of a learning curve, but the ant documentation is very good and it is well worth the effort. Even on small projects I think you will be happy with what it can do. E
My theory of evolution is that Darwin was adopted. - Steven Wright