Tuesday, September 12, 2006

CruiseControl.NET - Using the Multi SourceControl block with filters

As some have been led to observe, the documentation that goes with CruiseControl.NET is, charitably speaking, a little sparse. This is particularly true of the Multi SourceControl Block, which, unsurprisingly, allows the use of multiple source control blocks in a project. In the project that I am currently working on, I have some five separate CVS projects to check, and to add to the fun, I wanted to add some path filters to the mix. So, after a little trial and error, and a quick peek at the source code, here's a code sample for using path filters with multiple source control providers:
<sourcecontrol type="multi">     <sourceControls>         <filtered>             <sourceControlProvider type="cvs">                 <executable>C:\Program Files\cvsnt\cvs.exe</executable>                 <workingDirectory>D:\Cvs\Services</workingDirectory>             </sourceControlProvider>             <exclusionFilters>                 <pathFilter>                     <pattern>**/build.number</pattern>                 </pathFilter>                 <pathFilter>                     <pattern>**/CommonAssemblyInfo.cs</pattern>                 </pathFilter>             </exclusionFilters>         </filtered>         <filtered>             <sourceControlProvider type="cvs">                 <executable>C:\Program Files\cvsnt\cvs.exe</executable>                 <workingDirectory>D:\Cvs\Console</workingDirectory>             </sourceControlProvider>             <exclusionFilters>                 <pathFilter>                     <pattern>**/build.number</pattern>                 </pathFilter>                 <pathFilter>                     <pattern>**/CommonAssemblyInfo.cs</pattern>                 </pathFilter>             </exclusionFilters>         </filtered>     </sourceControls> </sourcecontrol>

No comments: