• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

When to use ANT

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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...
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2373
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When someone starts using ANT, het finds it convenient even for small projects. You just have to prepare the build.xml file once and then have fun. The rest is yours.
 
Is that a spider in your hair? Here, threaten it with this tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!