Increase Build Speed for Automated Builds in Team Foundation Server - Matt Faus
in

InfoPath Dev

Qdabra® DBXL

Matt Faus

Increase Build Speed for Automated Builds in Team Foundation Server

Have you ever opened Team Explorer to kick off a build and watched in awe as the server stayed in the “Getting Sources” state for several minutes when the actual source code should only amount to a few kilobytes?  If so, this blog’s for you!

The default for a new build created by the “New Build Type Wizard” from Team Explorer is to copy all of the source code for the entire Team Project into an intermediate directory before attempting to compile it.  As seen in Figure 1, the default build copies everything outlined in red, even though you might only need the folder shown in blue.

Figure 1. Default versus necessary code copy.

One way to solve this is by segmenting the Team Project into smaller pieces, but sometimes this just does not make very much sense and can also be a maintenance nightmare.  Instead, you can make a simple edit to the Build script to only copy the necessary files before trying to compile.

1.       From Source Control Explorer check out and open the $/_TeamProject_/TeamBuildTypes/_BuildType_/TFSBuild.proj file, substituting the appropriate values for _TeamProject_ and _BuildType_.

2.       At the very bottom of the file, paste the following XML between the closing ItemGroup tag and the closing Project tag.

<Target Name="CoreGet"

  Condition=" '$(IsDesktopBuild)'!='true' "

  DependsOnTargets="$(CoreGetDependsOn)" >

  <!-- Get all the latest sources from the given workspace-->

  <Get Condition=" '$(SkipGet)'!='true' "

    Workspace="$(WorkspaceName)"

    Recursive="$(RecursiveGet)"

    Force="$(ForceGet)"

    Version="$(VersionToGet)"

    FileSpec="$/Cadabra/Infomentum/QdabraWebDavRootHandler/Properties" />

</Target>

3.       Alter the value for the FileSpec attribute to match your project.

4.       Save the file, check in, and initiate the build.

5.       Compare build times to realize how much time you just saved.

Below are some links to the articles that helped me figure this out and a screenshot with a bigger view on the .proj file so you know exactly where to paste the code snippet.

·         http://msdn2.microsoft.com/en-us/library/0k6kkbsd.aspx

·         http://msdn2.microsoft.com/en-us/library/aa337598(VS.80).aspx

·         http://blogs.msdn.com/nagarajp/archive/2005/10/21/483590.aspx

Figure 2. The final result of the Build edit.

Comments

 

dvd record vhs said:

Your comment is 0 characters limited to 3000 characters.

June 10, 2008 7:42 AM
 

shrink dvd said:

June 10, 2008 8:40 AM
 

dvd burning said:

Fortunately, we can strip this down for the sake of a simple test. We’ re using a local target so step 1 is unnecessary. We can also hard- code the MAC of the target machine, to also skip steps 2 to 4. An ICMP ECHO request packet can then be constructed

June 11, 2008 7:15 PM
 

dvd copy said:

There is no guarantee that the space used by a file generated with filegen will be consecutive. If you want to program with this kind of control, use the Windows Defragmentation API:

June 12, 2008 1:03 AM
 

dvd decrypter error said:

Trackback is a technology used by content publishing software like wordpress, movabletype, blogger etc to acknowledge url added in the commenting of post. The trackback acknowledge is sent using network ping from the originating site to receiving site

June 13, 2008 12:11 AM
 

www.easiestdvdripper.com said:

Other advances include solid- state photon detectors that led to today\'s night vision capabilities and microwave and millimeter- wave monolithic integrated circuits, or MIMICS, that enable cell phones and miniature global position system receivers to

June 13, 2008 9:00 AM

About Matt Faus

Matt holds a BS in Computer Science and Software Engineering from the University of Texas at Dallas. During his studies, he helped Qdabra Software develop DBXL and InfoPath solutions. During that time he lived in Dallas, Seattle, and Valencia, Spain. He now works at Microsoft, developing for Hotmail.
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.