What NAnt Is NotNAnt is not a magical solution. If proper software engineering techniques are not applied, NAnt can actually complicate a project. However, this could be said of any software engineering tool (such as Software Configuration Management). Even though NAnt is a powerful tool, it still requires good communication and organization of the development team. Everyone on the team should know NAnt, but at least one person on the team should specialize in NAnt and be the coordinator for the automated build. NAnt is not an XML version of MAKE (http://www.gnu.org/software/make/makel). NAnt and MAKE have similar goals and even some similar nomenclature; however, they really are more different than alike. A NAnt target is closest to a MAKE ghost target. A MAKE target is assumed to reside in a separate file. A NAnt target (see Figure 4-1) is assumed to exist in the same file as the project. NAnt creates target dependencies and allows the tasks (Figure 4-1) to determine the file dependencies. This is much different in MAKE. Figure 4-1. Conceptual View of a NAnt Build File.NAnt is not meant to replace an Integrated Development Environment (IDE). IDEs are a definite time-saver. A strong point of Microsoft development has always been high quality IDEs. However recently even Microsoft's Consulting Division and an internal division in Redmond announced an automated build technology called BuildIt, which is covered later in this chapter, becuase Microsoft now realizes the advantage of an IDE as well as scriptable builds. GNU also saw the importance of a scriptable build, andChapter 2, I showed several IDEs for C#. NAnt allows everyone on the team to use his or her favorite IDE. This actually saves time in that everyone does not have to abandon the editor they are familiar with and waste time learning a new one. NAnt is not a scripting language, although at first you may be tempted to think of it as such. It is easy in the first few projects to create builds that are very script-like. I hope the best practices shown here that result from my experience will help you along faster. NAnt is not Ant. NAnt is the .NET port of the Apache Java project Ant (see http://ant.apache.org). Some of the Ant documentation can be helpful, but a lot of Ant was designed to compile Java code. The Java compiler puts strict restrictions on the class naming matching the directory structure of your code. This is not true with C#, and NAnt builds are simpler because of it. NAnt has a lot of .NET-specific tasks that require an in-depth knowledge of the .NET runtime. |