Anyone that has looked at the shipped build process templates in Team Foundation Build 2010 will agree that they are large and relatively complex. This is a good thing if you are wanting to use them out of the box or simply extend them because it means you get a lot of functionality (that has been designed, implemented, and tested for you) for free.
But what if you’re needing to design a totally custom build process? Well this is exactly what I had to do recently and it got me wondering, what is the most minimal build process template possible? It turns out that the most minimal build process template possible is a single, empty, workflow activity. That’s all… Your workflow does not need to use or reference any Team Foundation Build namespaces or activities to be considered a valid build process template by Team Foundation Build and to build successfully.
So how can you test this for yourself? It’s easy:
- Create a new Workflow Activity Library project (e.g. MinimalBuildProcess).
- Rename Activity1.xaml to MinimalBuildProcessTemplate.xaml.
- Add MinimalBuildProcessTemplate.xaml to version control (typically in $/TeamProjectName/BuildProcessTemplates but you can choose any location).
- Add a new build definition that uses that template.
- Right-click Builds and choose New Build Definition.
- Give the build definition a name (e.g. Minimalist Build Process).
- On the Build Defaults tab de-select This Build Copies Output Files To A Drop Folder.
- On the Process tab click Show Details and then (see the screenshot below for details):
- Click New to register a new Build Process Template.
- Click Select An Existing XAML File.
- Browse to the MinimalBuildProcessTemplate.xaml.
- Click OK.
- Save the build definition.
- Run the build definition.
- Bask in its minimalist nature.
- Stay tuned for “What is the most minimal build process template possible that actually does something?”.
For reference, MinimalBuildProcessTemplate.xaml should have the following content:
<Activity
mc:Ignorable="sap"
x:Class="MinimalBuildProcess.Activity1"
sap:VirtualizedContainerService.HintSize="240,240"
mva:VisualBasic.Settings="Assembly references and imported namespaces for internal implementation"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:s1="clr-namespace:System;assembly=System"
xmlns:s2="clr-namespace:System;assembly=System.Xml"
xmlns:s3="clr-namespace:System;assembly=System.Core"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System"
xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel"
xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core"
xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:sd="clr-namespace:System.Data;assembly=System.Data"
xmlns:sl="clr-namespace:System.Linq;assembly=System.Core"
xmlns:st="clr-namespace:System.Text;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"/>