Build definition

To create and edit build definitions you must use Visual Studio 2013.

When building MSI files the build service account must be a local administrator in the build server.

For the build process, we need a PowerShell script called “GatherItemsForDrop.ps1”. Download it from: http://tfsbuildextensions.codeplex.com. Check it in to source control in a folder called “BuildScripts” under the Dev branch.

BTDF outputs MSI files, so we need to modify the script to include those files.

GatherItemsForDrop.png

For the dev branch, create on build definition for each solution. That way, developers will get quick feedback after check-in.

Build1.png

Use “Continuous Integration” to trigger a build on check-in. Depending on project size (number of developers) you may want to use “Gated Check-in” instead.

Build2.png

In the “Source Settings”, you specify what the build agent should download from TFS source control before the build starts and where to store it on the build server. It is important to select only the source needed for this build. If you select more than you need, it will just be a waste of bandwidth and time. It is also important to pay attention to the build agent folder. If you build more than one solution, and those solutions have dependencies on each other, you must make sure their relative path is the same on the build agent as in source control.

Build3.png

Select build controller and drop folder.

Build4.png

Select the “Team Foundation Version Control” template (TfvcTemplate.12.xaml). In previous versions of TFS you had to make a custom template in order to build BTDF projects. That is no longer needed in TFS 2013.

Select the solution(s) you want to build. First the BizTalk solution and then the btdfproj project. For the Dev brach, build the “Any CPU|Debug” configuration.
Set the “Output location” to “AsConfigured”. This causes the build agent to build in the same way as Visual Studio.

The “MSBuild platform” must be “X86” to build BizTalk solutions. If it is “Auto” the build will fail in mysterious ways.

Set the “Post-build script path” to the GatherItemsForDrop.ps1 script. When the output location is change to “AsConfigured” TFS no longer copies the output to the binaries folder. We must do that ourselves using a script. TFS the copies the binaries folder to the drop folder.

Build5.png

Usually there is no need to change the default retention policy.

Build6.png

Save the build definition. Right-click the build definition in Team Explorer and select “Queue New Build…” to start building. The build will also start if you check in changes to any of the source folders you specified in the build definition.

Build7.png

Previous Next

Last edited Mar 3, 2014 at 9:37 AM by hallis, version 6