ANT’s best practices - IX

13 May 2008

Testing the build file is important. You don’t want other coders complaining about your ANT script.

Lets assume that the build file has clean and compile targets. In this case plan the test as follows:

> Type ant clean
> Type ant compile
> Type ant compile again. This should do nothing and if files compile second time then it means that there is something wrong with your buildfile.

A build file should perform work only when input files change as compared to corresponding output files. If your build file compiles, copies, or performs some other work when it is not necessary to perform the work, then it means that your build file is inefficient. This is inefficient and should be dealt with properly.

Another tips is to avoid platform specific Ant wrappers. For whatever reason, some people like to ship their products with simple batch files or scripts called something like compile. Its not a good idea to include a platform-specific script that does nothing but invoke Ant. It is possible that you will fail to provide scripts for every operating system which is not you intend.

I hope this will hlep you write better ANT scripts for your build process.

del.icio.us:ANT's best practices - IX  digg:ANT's best practices - IX  spurl:ANT's best practices - IX  wists:ANT's best practices - IX  simpy:ANT's best practices - IX  newsvine:ANT's best practices - IX  blinklist:ANT's best practices - IX  furl:ANT's best practices - IX  reddit:ANT's best practices - IX  fark:ANT's best practices - IX  blogmarks:ANT's best practices - IX  Y!:ANT's best practices - IX  smarking:ANT's best practices - IX  magnolia:ANT's best practices - IX  segnalo:ANT's best practices - IX  gifttagging:ANT's best practices - IX

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: ANT's best practices - IX

Leave a Reply