Home > Articles > Programming > .NET and Windows Programming

Automating Your .NET Development With Nant

Stewart Baird
  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Programming in the .NET Environment

Like this article? We recommend
Programming in the .NET Environment

The process of integrating the components that go to make up a software product can be a complex, difficult and frustrating ordeal. Stewart Baird tells you how to use Nant to simplify the task of creating automated builds on your .NET projects.

Why Automate Builds?

Why would you want to automate your software development? Does automation offer anything beyond the "gee-whiz" factor—look, no hands! Companies like Microsoft have been using the practice of daily builds for years now. The process of integrating the components that go to make up a software product can be a complex, difficult, and frustrating ordeal. Development teams that are still using the manual approach will integrate infrequently, often only at release time. Developers work on their own machines and then copy files around the network to a central build folder or such like. The build engineer has the unenviable task of making sense of all the madness. Its all too common to see software that worked like a charm on Joe's PC falling into a heap when combined with the rest of the team's bits. Integration is painful, so the answer is to treat it like a trip to the dentist—avoid it until you simply have to do it!

The trouble is, the longer you leave integration, the greater the pain when it finally comes around. Trust me, I know about this from my dental experiences (or should I say trauma). Prevention is better than having your mouth turned into an open-cast mining site. So, if we could automate the process, we could integrate or build whenever we wanted. At the very least, we could build daily and maybe more than that—continuous integration. Figure 1 illustrates how the number of source code changes increases over time.

Figure 1Figure 1 Source code changes over time.

This is all well and good, but you may still be wondering why your customer should care about the pain aspects of integration. In one way, they aren't concerned about the team's journey into the inner circles of misery, but they do care about their software. Getting the software into a known good state and then keeping it there is one of the best indicators to the health of the project. The customer can see working software, albeit a bit rough around the edges, and the team has a benchmark. Integrating the software, running the tests, and getting the green bar of success from NUnit give the team the confidence to move forward.

Automating development is vital because it allows the team to integrate frequently and ensures the customer that the product has life. In the past, development teams have used a combination of script and make files to run daily builds. The last few years have seen the development of an XML-driven build tool: Ant. Ant is part of the Jakarta project and runs under Java. (We'll discuss more about how you can use Ant with .NET in an upcoming article.) As you might have guessed by now, Nant is a .NET port Ant.

Without further ado, let's meet Nant.

  • Share ThisShare This
  • Your Account

Discussions

Make a New Comment

You must log in in order to post a comment.

Related Resources

Danny KalevMinutes from the October 2009 Meeting
By Danny Kalev on November 19, 2009 No Comments

The minutes from the Santa Cruz (October 2009) meeting are available here. Even if you're not a language layer at heart, I encourage you to read them.

Danny KalevA Reader's Opinion on Attributes
By Danny Kalev on October 20, 2009 No Comments

In August I dedicated a series to the debate about C++0x attributes. I believe that it covered the subject in a balanced and detailed way, but I keep getting complaints from C++ users who don't like attributes for various reasons. Here's a recent email I received from a Polish C++ programmer. While it  doesn't represent my opinion about attributes -- I'm rather neutral about this feature and consider it a "solution waiting for a problem" -- but it suggests that attributes are still a highly controversial issue that will haunt C++ for a long time. The email is quoted here with minor edits that and as usual, with all private details removed.

Danny KalevFollowup: The Web 2.0 Guy I Ain't
By Danny Kalev on October 16, 2009 1 Comment

Almost a year ago, I posted here The Web 2.0 Guy I Ain't. People wonder whether I still resist all those Web 2.0 features and technologies at the end of 2009.

See All Related Blogs

Informit Network