TFS Build strategies for large projects

For large projects that has multiple solutions and many dozens class library projects, Scheduled build or Continuous Integration build often takes lot of time to build entire projects.  The reason not to use Continuous Integration build often leads to build time.  Build takes so long to finish so Continuous Integration build can’t be use.   If that is the case with you,  you many need to reorganize projects or solutions to build efficiently.  I will give you an overview of our project structure and how I improved build time so I can take an advantage of Continuous Integration build.

We have four huge web application and every web application has their own solution.  There are shared class library projects that being used across web application.  Each solution has class library projects references (not DLL reference) that web application uses it because it is very handy when class library project needs to be changed.  We were only using Scheduled build (nightly build) because our build takes around 35-40 minutes to finish.  Why build takes so long? Because we have many dozens class library projects that each solution needs to build.  Each solution needs to compile class library projects that referenced in it so if you have shared class library projects reference in multiple solution, each solution will build that class library projects.  To avoid that, we have created master solution that has all our web applications and class library projects.  Master solution is only being used for build.  Using master solution strategy, build time is reduced to 15 minutes (almost reduced by 50%).  You can also even drop build time by using separate build server which will take TFS server load off.

Since we got success reducing build time, we want to use Continuous Integration build.  To shorten Continuous Integration build time, there are some settings in TFS 2010 build that can be used.  I think only purpose of Continuous Integration build to make sure source code compiles without any error for every check-in.  You don’t need to package build output nor other things like work item creation on build fail, labeling source code, etc…  You can turn off those things for Continuous Integration build that will even improve build time.  Here are the few things that I turned off for Continuous Integration Build.

<SkipLabel>true</SkipLabel>
<SkipGetChangesetsAndUpdateWorkItems>true</SkipGetChangesetsAndUpdateWorkItems>
<SkipWorkItemCreation>true</SkipWorkItemCreation>
<SkipDropBuild>true</SkipDropBuild>

If master solution approach doesn’t work with you for any reason, I would suggest you to read good topics listed below.

Strategies for Solution and Project Structure

Guidelines: Team Build

Hope this helps.

Posted in Microsoft Technology Tagged with: ,

Ads