Daily builds are your friend
], as Joel Spolsky puts it. I'd have to agree with that, and it turns out to be fairly easy to create a daily build server using a batch-file and a vbscript.
First; the batch file. We'd need to fetch the latest source code from the source control system. We're using SourceSafe
] at work, and it can update the sourcecode on your harddisk using a simple DOS-command;
"C:\Program Files (x86)\Microsoft Visual SourceSafe\ss.exe" Get -R -I- $/SkyNet -GLC:\Users\Eddy\Documents\Source -YEddy,
Tortoise can do the same
], of course.
Now that we got the new source, we'd need to build it. We can call the IDE using the commandline to do so;
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" "C:\Users\Eddy\Documents\Source\SkyNet.sln" /build Debug
Going a step further than building, you could also run your unit-tests using mstest.exe
] (assuming that you're using the Microsoft environment for your unit-tests)
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:"C:\Users\Eddy\Sources\SkyNet\bin\Release\SkyNetTestStuff.dll" /resultsfile:"C:\Users\Eddy\Desktop\SkyNet TestResults.trx" >"C:\Users\Eddy\Desktop\SkyNet TestResults.txt"
You could even hook up FxCop
"C:\Program Files (x86)\Microsoft Fxcop 10.0\FxCopCmd.exe" /project:"C:\Users\Eddy\Documents\FxCop Projects\SkyNet.FxCop" /directory:"C:\Users\Eddy\Sources\SkyNet\bin\Debug" /console /searchgac /console >"C:\Users\Eddy\Desktop\SkyNet FxCop Report.txt"
FxCop is a valuable helper, even if you only use it to find unused variables and dead code. You can exclude the rules that you're not interested in. You could convert the
format to HTML using a free tool
Put these commands together in a batch-file, and you can build, test and analyze your project with a single action. What's more, you can use vbscript to send you the text-files by email
] as a result.
Now you have a batch file to do your build (and unit-test, and perform statistical analysis) and a vbscript to email you these results. Hook it up into the Windows Task Scheduler
] to run it once a day, and you'll receive mails like these:
Results Top Level Tests
6/6 test(s) Passed
Test Run Completed.
Results file: C:\Users\Eddy\Desktop\SkyNet TestResults.trx
Test Settings: Default Test Settings
Microsoft (R) FxCop Command-Line Tool, Version 10.0 (10.0.30319.1) X86
Copyright (C) Microsoft Corporation, All Rights Reserved.
Loading C:\Users\Eddy\Documents\FxCop Projects\SkyNet.FxCop...
Initializing Introspection engine...
Writing 205043 messages...
[Location not stored in Pdb] : warning : CA1709 : Microsoft.Naming : Correct the casing of 'SkyNet' in namespace name 'SkyNet' by changing it to 'Skynet'.
Create a "daily build results" label in your email-client and create a rule to route those emails to the label.