Cleaning and Building… Definitely do it seperately.
Published 3.05.2007 by ~mattg
The autobuild script has been working quite well for a few weeks now. Last week I changed it to utilize an xml configuration file instead of having to modify the script to change build parameters. This makes it quite easy to have different build tasks ready and waiting. The one thing I really wanted to do was to have the build clean the project (remove all compiled libraries, object files, and built dll files) so that my rebuild would be a true rebuild and expose any linking errors or circular dependencies that I may have created.
So I added this short code block to launch devenv.exe as a process with clean on the current solution being built:
$devenv.StartInfo.FileName = “C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe”
if ($bCleanFirst)
{
$date = Get-CurrentDateTime(“HH:mm”)
Write-DTPair $g_strEmailLog $date “Cleaning Solution”
$devenv.StartInfo.Arguments = “$strCleanOpt `”$strMasterSolution`”“
$devenv.Start()
$devevn.WaitForExit()
}
If you notice the last statement there, I misspelled the variable (”$devevn” instead of “$devenv”), This didn’t cause the script to stop executing, it just meant that the “cleaning” process was started and then the script moved on to the next statement, which happened to be the build statement. So basically, while one process was busy building dlls, the other process was busy deleting them. Hence, I ended up with a lot of linker and missing dependency errors.
I guess that’s what happens when I don’t have a compiler telling me I did something bad.
Filed under Windows