CruiseControl.Net patches

Hacking CruiseControl.Net to work better for my specific circumstances (lots of projects that depend on lots of projects) has resulted in the following patches to revision 3607 of ccnet which I’m just about to submit to the developers.

These patches are ‘supporting patches’ to the main ProjectTrigger and integrator changes, I thought I’d start with the simple ones… None of these patches should change existing functionality, all require new, optional, properties to be specified to activate the new code. All patches include updated and or new tests.

  1. IntervalTrigger - Added initialIntervalSeconds.

initialIntervalSeconds is a new property that controls when the trigger fires the first time. The idea being that you might want to have a trigger that fires every ‘X’ seconds but you dont want to have to wait a full ‘X’ seconds for it to fire when the server first starts up. If initialIntervalSeconds is set then the trigger will first fire after this number of seconds and will then switch to firing every intervalSeconds as normal.

I find this useful when running ccnet on machines which aren’t dedicated build machines (i.e. machines that don’t have ccnet running all the time) for projects that I don’t want to run very often but, when I start ccnet, I want them to be checked…

ccnet-3607-IntervalTrigger-InitialInterval-Patch.txt

  1. IFileSystem changes - Added some more functionality to support the tests for the changes in patches 3 and 4.

Added CreateDirectory() and DeleteDirectory().

ccnet-3607-IFileSystem-Patch.txt

  1. CVS source control - allow non existent working directory to be created.

Changes to DoesCvsDirectoryExist() and NewProcessInfoWithArgs() to allow for creation of working directory if required for checkout or update only.

ccnet-3607-CVS-CreateWorkingDirectory-Patch.txt

  1. FileSourceControl - allow working directory to be specified and added a property to force deletion of remove files during GetSources.

I’ve added a working directory property so that you can have a FileSourceControl source control block that checks files out to a sub directory of the project’s working directory. This is useful if you are accumulating files from multiple source control blocks into a directory tree and want to place some of the files in subdirectories.

The second change forces the working directory to be removed before an update occurs. This is a brute force method of removing files which no longer exists in the repository from the working copy.

ccnet-3607-FileSourceControl-Patch.txt

  1. Visual C++ version 6 “MsDev” build task.

Added a new build task that works with Visual studio 6.

ccnet-3607-MsDevTask.cs

ccnet-3607-MsDevTaskTest.cs

  1. Allow you to specify which version of Visual Studio is used if mutliple versions are installed without having to know the executable path. Although you can currently select the version of visual studio that is used you need to do it by providing the full path to the executable this patch allows you to simply say “I’d like Vs2003 please” and then used the registry query code to work out where it is installed. This is enabled by specifying a Version property with a value of one of the following: “9.0”, “8.0”, “7.1”, “7.0”, “VS2008”, VS2005", “VS2003” or “VS2002”. I considered, and rejected, having the DevenvTask read the solution file and work out the appropriate version as unecessarilly complex.

This removes the need to embed potentially machine specific information in a config file just to select which version of VS you want to use; though, unfortunately it doesn’t help me on Vista x64 as the InstallDir value isnt present in the registry :(

ccnet-3607-DevEnvTask-VersionSelect-Patch.txt

With any luck these will be approved and incorporated into the subversion ccnet repository soon, but, if they’re not you can get them from here.

I’m currently working on tidying up the ProjectTrigger changes that are mentioned here and these will be released later. The Sleep() changes to the ProjectIntegrator were more complex than expected (mainly due to the design of the integration thread), although my hacked version works for me it’s not good for prime-time so I’m working on a better fix.