One of the most useful techniques I have found in working with CCNet and VSS is the ability to monitor multiple VSS project folders to trigger a build. Many times, you will find your solution structured such that monitoring a top level folder may not be the right level for triggering a build. If this is your problem, then <sourcecontrol type=”multi”> might just be your solution.
Here is a simple example of how you can monitor multiple projects within VSS to trigger a Visual Studio build to happen:
<project name="MySoftware">
<workingDirectory>C:\Dev\ProjectXYZ\4.0\GUI</workingDirectory>
<modificationDelaySeconds>10</modificationDelaySeconds>
<sourcecontrol type="multi">
<sourceControls>
<vss>
<executable>C:\Program Files\Microsoft Visual SourceSafe\SS.EXE</executable>
<project>$/Dev/ProjectXYZ/4.0/GUI</project>
<username>BuildUser</username>
<password>BuildPassword</password>
<ssdir>\\server\share\vssdir\</ssdir>
<workingDirectory>c:\dev\projectxyz\4.0\GUI</workingDirectory>
<cleanCopy>true</cleanCopy>
</vss>
<vss>
<executable>C:\Program Files\Microsoft Visual SourceSafe\SS.EXE</executable>
<project>$/Dev/Shared/ComponentABC/5.1</project>
<username>BuildUser</username>
<password>BuildPassword</password>
<ssdir>\\server\share\vssdir\</ssdir>
<workingDirectory>c:\dev\shared\componentabc\5.1</workingDirectory>
<cleanCopy>true</cleanCopy>
</vss>
</sourceControls>
</sourcecontrol>
<tasks>
<devenv>
<solutionfile>MySoftwareSolution.sln</solutionfile>
<configuration>Release</configuration>
<executable>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe</executable>
</devenv>
</tasks>
</project>
In this example, we are watching for code changed in either ProjectXYZ or shared ComponentABC. Monitoring recursively for any changes below $/Dev may cast much too large of a net to effectively limit the number of CI builds triggered.
Another useful application mentioned on the CruiseControl.NET documentation for this feature is that you can monitor different types of repositories, including a filesystem. So if you have some dependencies that you want to rebuild with that get posted to a file server, this can trigger a build based on changes there as well.
Filed under: Continuous Integration | 6 Comments »
