Steve Michelotti

C#, ASP.NET, and other stuff

  Home  |   Contact  |   Syndication    |   Login
  108 Posts | 1 Stories | 413 Comments | 51 Trackbacks

News

View Steve Michelotti's profile on LinkedIn






Google My Blog

What I'm Reading:

Shelfari: Book reviews on your book blog

Tag Cloud


Archives

Post Categories

Image Galleries

Blogs

Code

Publications

You want to set up a customizable, fully automated build process.  You want your build process to incorporate FxCop, NUnit, NCover, etc. but you do not have the license for Team System.  No problem.  You can do all of this with free tools leveraging MSBuild and Cruise Control .NET (CCNet) as the basis of your solution.  This is not new news.  In fact, CCNet is probably the best known tool today to do automated builds.  However, there are lots of different ways to implement your build process.  I'm going to do a series of posts that provide a start to finish implementation of one way to set up your build server.  The posts will eventually include custom MSBuild tasks, custom CCNet add-ins, 32 bit / 64 bit considerations, and building MSI files with MSBuild.  In this post, I will just start with the primary structure and build process.

To kick off the MSBuild process, you'll use the standard "msbuild" task provided by CCNet pointing to the custom MSBuild project file that we'll construct "ccnetMSBuild.proj":

<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
<workingDirectory>C:\CCNetArtifact\MyProjectName\Working</workingDirectory>
<projectFile>C:\Program Files\CruiseControl.NET\MSBuildScript\ccnetMSBuild.proj</projectFile>
<timeout>600</timeout>
<buildArgs>/p:ProjectFile=$SolutionFile$</buildArgs>
<logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
</tasks>

 The basic outline of the msbuild script will be this:

  1. Version assemblies in the current solution (details to come in a later post)
  2. Do a Debug build (if compile fails, stop build)
  3. Run FxCop on the solution
  4. Run NUnit on the solution
  5. Run NCover on the solution
  6. If everything has run successfully, do a Release build

First, we utilize the standard msbuild task to do a Debug build.  Why do a Debug build before a Release build?  There are a couple of reasons.  First, Debug is the default mode for the developer on their local systems.  We encourage the developers to run FxCop locally before checking in - it's most convenient for them to be able to do this straight from Debug mode without having to first rebuild in Release mode.  Additionally, we typically will set our NUnit projects to build only in Debug mode but not in Release mode because we do not want to deploy NUnit projects out to a production environment.  Again, keeping it in Debug mode simplifies everything here.

This is the standard structure - in the interests of keeping this post a reasonable length, I will expand on the details on my next post...

posted on Friday, February 23, 2007 7:17 PM

Feedback

# re: MSBuild with Cruise Control .NET 9/3/2007 3:58 AM Ashok boddeda
Certainly, we need more info to get familiar with mentioned tools. However good article to read out.

Regards,
Ashok

# re: MSBuild with Cruise Control .NET 10/22/2007 1:10 PM Mary
Steve, you have at the very end of this blog " I will expand on the details on my next post..." Did you ever create this series? If so can you please send me the links?

Regards,
Mary

# re: MSBuild with Cruise Control .NET 3/14/2008 2:07 AM Harish Kumar
Steve, Will this create a new MSI with the new label (CCNET Label) evry time build succeeds?
Also I havent got any project file with ccnet1.3.1 (C:\Program Files\CruiseControl.NET\MSBuildScript\ccnetMSBuild.proj). Please help me. I wanna make a new MSI according the label change......


Thanks

# re: MSBuild with Cruise Control .NET 7/15/2008 12:31 PM Nabeel Khan
Where is the next part.

# re: MSBuild with Cruise Control .NET 5/18/2009 3:18 AM Ajit Dusane
Hey,

could you please mail me all the stuff that you have related to cruise control .net ???

Thanking you in anticipation.

Regards,
Ajit D

# re: MSBuild with Cruise Control .NET 5/18/2009 8:33 AM Steve
@Ajit - This was one of a few posts a did on MSBuild a while back that I never got around to "fully" completing. Here is a link to some other topics: http://geekswithblogs.net/michelotti/category/6259.aspx. Additionally, if you have questions on any *specific* areas I can try to help. Thanks.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: