• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When to use ANT

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic