After having configured my MSBuild scripts for use in TeamCity I found this rather nifty page in the NCoverExplorer UI. You basically configure the NCover report via the UI. Open up the NCoverExplorer application and click File -> Run NCover. You are then presented with the Runner dialog box where you set various parameters in the UI. You can then press various buttons and it will write your Nant/MSBuild or command line for you! Very neat …
Editing MSBuild Xml files can be a bit of a chore. For general everyday file editing I tend to use NotePad++ which is an awesome file editor and viewer. However, you can use Visual Studio to edit your MSBuild files and at the same time get Intellisense!
Open up Visual Studio and go to the Tools -> Options and go to the Text Editor options then you can associate file extensions to text editors. For MSBuild files we need to associate things like “proj” to “XML Editor with Encoding”. Now we also have intellisense to help write the script.
Now Visual Studio will be able to load the .proj MSBuild script into the correct editor and you can obviously associate *.proj files with Visual Studio to launch into them from Windows Explorer.
I have finally completed the set-up and configuration of my new continuous integration system for SampleSort. I have to say that I’m seriously impressed with TeamCity. The installation and configuration was straight-forward and has been rock solid.
One thing I would say is that after installation I’d recommending switching to SQL as the database back end immediately. I started off using the internal database and found the migration tool very awkward so I’m now missing some data from the initial build runs but I can live with that.
I have configured two build configurations for my SampleSort project. The first build configuration works in Debug mode and runs the following reports:
This debug build configuration is triggered after a Subversion source code commit and is set-up to fail the entire build if there are any tests that do not pass.
The second build configuration works in Release mode and performs a simple Release build of the same source code on the event of a successful Debug build. The last step in this Release build configuration is to then run an Inno Setup compiler script to package the release mode application into the final application installer.
At the moment this last task is simply an MSBuild Exec command so it all happens outside of the TeamCity scope if you will, this just means that any reporting isn’t included in the TeamCity results.
So far getting this all set-up and configured has actually been a very time consuming task. There have been many points of confusion along the way so I’m going to add another blog item soon that goes into a bit more detail of how I went about getting each of these build tasks set-up. I still have a few niggles that need to be ironed out of my script that relate to MSBuild batching, basically during the test phase there are actually multiple passes of the tests in order to produce the test reports. This does have a knock on effect of making each build pass a little more time consuming than it need be but also in the great scheme of things this isn’t a huge problem.
I have to say that to have all of this (TeamCity, xUnit, NCover, NCoverExplorer) for free really is inspiring in many ways. A lot of blood, sweat and tears went into making all of these tools and I’m now benefitting (and my users) with zero financial outlay, I tip my hat to the developers! I also have to thank Patrick for the free NDepend licence!!