ANT’s best practices - I
10 May 2008ANT makes building complex Java applications easier. But many people argue that managing ANT scripts is itself a cumbersome task and involves a lot of effort. In the next few posts, I will talk about how one can adopt best practices for creating and managing ANT scripts that will make the life of developers and configuration managers easier.
First thing is, one should follow a consistent style while writing XML for ANT files. If you format your ANT script, it will be visually appealing and will be more readable. Using a good XML editor that highlights the syntax will also help. One important thing is that you should use meaningful target and property names in the ANT script and you should be consistent with the naming convention.
ANY buildfile can be places anywhere but it’s a convention to place the buildfile (build.xml) in the top-level project directory. This will keep things simple and clean. Normally developers expect to find build.xml in this location. This also helps see how relative paths point to different directories in your project tree. Some developers prefer to have more than one build files in case of big and complex project. Even in that case, there should be a primary build file that should manage the other build files. And this primary build file should reside in the top-level project directory.
Related Posts:
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 - I