This article will describe some of the development tools that are available from the Java Open Source community and explore how they can help you create high-quality software in a predictable and reproducible fashion, saving you precious time and money. It is taken from chapter three of the book Enterprise Java Development on a Budget, written by Brian Sam-Bodden and Christopher M. Judd (Apress, 2004; ISBN: 1590591259).
Development and Build System with ANT - The all Target (Page 11 of 11 )
Finally, itís a common practice to make the buildfile default target a target named ďall,Ē which has in its dependencies a list of the targets that represented a full build of the system. If your build process has any noncritical targets that take a fair amount of time to generate, you can create new targets that will do whatever the all target does in addition to any extra work a target such as all-with-docs does. The point is that you want to minimize the amount of time that it takes to build the application so that developers donít have noticeable interruptions in the flow of their work. A typical all target looks like this:
<!-- ====================================================== --> <!-- Does it all --> <!-- ====================================================== --> <target name="all" depends="compile,..." description="Generates, compiles, packages and deploys." />
In this chapter you learned the importance of having a solid build system in place, the basics of the Ant build tool. You tailored an Ant buildfile to automate the build process of the TCMS system. The resulting buildfile reflects our experiences building many Java and J2EE applications. You can apply most of the ideas used in this file to your existing and future projects.
As a programmer, you strive to write reusable software components and itís natural to attempt to do the same with a systemís build scripts. Itís important to understand that Ant isnít a scripting language and that complex tasks are meant to be encapsulated inside of Ant tasks. Therefore, if your buildfiles become too complex donít feel compelled to stick solely with whatís distributed with Ant. Feel free to explore the countless commercial and Open Source Ant tasks available or begin writing your own.
1. Marshall McLuhan and Quentin Fiore, The Medium Is the Massage: An Inventory of Effects (HardWired Books, 1996).
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.