Thursday, April 13, 2006

Automating builds with PVCS and MSBuild

We are currently using PVCS version 6.8 as the Source Code Control system on a large .Net project. The project consists of 30 Assemblies so the builds take quite a while. I have been trying to get automated builds working so that we can run them as an overnight job. The script turned out to be quite simple in the end but working out the right combination of options was a trial and error process. Here is the script we used in the end:

REM -aworkpath Path to place workfiles in. Overrides default workspace for project
REM -bpprojpath path to base project to use when resolving references, required when -a or -o specified
REM -prDBpath to PVCS database
REM -z recursive flag, operate on specified project and all sub-projects
REM -gPromotionGroup get files with specified promotion group or higher
REM entity project to operate on

x:\vm\win32\bin\pcli get -bp"/Billing/Source" -gGBDEV -pr"X:\VM\vmdevint" -aH:\gettest -z "/Billing/Source"
REM cd to workpath
cd H:\gettest
REM
REM C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild /logger:EmailLogger,"C:\EmailLogger\bin\Release\EmailLogger.dll";To=buildmanager@tempuri.org;From=buildmanager@tempuri.org;Subject=BuildLog:%DATE%;Host=mail.tempuri.org Billing.sln
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild Billing.sln

The commented out call to msbuild includes a call to a custom logger that will email the results of the build. The source code for the logger was obtained from this blog

No comments: