Faster builds with VSTS Team Build

Tags: CI, TFS, VSTS

 If you have big solutions with hundreds of projects and hundred of thoudsands lines of code, you know that by default compiling in the build server takes some time. One of the things that take most time is getting the sources to compile, and that's because by default the build script performs a FULL GET instead of a "normal" get (or incremental, just getting the things that changed from the last build).

In order to instruct the build agent to perform an incremental for VS2005 get you need to modify the build script and include the following:

<PropertyGroup Condition="Exists($(SolutionRoot))">
<SkipClean>true</SkipClean>
<SkipInitializeWorkspace>true</SkipInitializeWorkspace>
<ForceGet>false</ForceGet>
</PropertyGroup>

For VS2008 you only need to add the following:

·         </ItemGroup>·            <PropertyGroup>·               <IncrementalBuild>true</IncrementalBuild>·          ·            </PropertyGroup>·         </Project>


This means that the build script should not delete or initialize a previously existing workspace and don't try to force the GET operation for ALL sources. Another thing we can do to speedup the build process (specially in CI builds) is to avoid associating WorkItems with each build (that is only done on the RELEASE build done manually by the release manager), and therefore we need to include the following in the build script:

<PropertyGroup Condition="$(QuickBuild)=='True'">

     <SkipLabel>true</SkipLabel>

     <SkipGetChangesetsAndUpdateWorkItems>true</SkipGetChangesetsAndUpdateWorkItems>

</PropertyGroup>

Hope you find this information useful, 

Andres G Vettori, VMBC, CTO

http://www.vmbc.com

No Comments