Build Process Templates

Making a build script do exactly what you want is easier with 2010?

When setting up a build there has always been a separation of concerns.

  • The Build Definition
  • The Build Process

Creating the build definition is much like you are use to in 2008. Right click on the builds node in the Team Explorer and select New Build Definition. It’s no longer a modal wizard, however it’s the same of information.

  • Name and Description

  • How you want the build to be triggered

  • Working folders

  • Build Server and Drop Location

  • Retention Policy

However there is a big difference, and it relates to the separation of concerns I mentioned above. In 2008 you could create a project file, that you would later have to edit to get the build to do anything extra ordinary. When you hit create on the project file tab you would be launched into another wizard that allowed you to select the solution to build, the type of configuration you wanted to build, weather or not you wanted tests executed against the build and or static code analysis performed.

In 2010 the Process tab contains a type of property grid which allows you to change the configuration of the build. This grid is organized into 3 sections Required, Basic and Advanced, allowing you to specify the solutions to build, define the build number, how to deal with tests and code analysis, weather or not to perform test impact analysis or label the source at this build to name just a few.

Where is all this defined? How would I add extra functionality to my build? What if I wanted to replace a dev.config with a test.config or deploy extra files to the drop location?

At the top of this tab is a show details expander.

image 

After expanding this area you will  be able to select from a list of Build Process Templates.

image

Each template can contain different build processes. Beta2 comes with three templates to get you going. Click New to create your own by selecting a XAML file you have already created a placed in source control, or copy one of the existing templates as a starting point. You will notice also that you can store your Build Template anywhere in source control. In previous versions they only ever existed in one place under source control.

With 2010 you can create a build using the default template, which will likely do most, and more likely all of what you need it to do. In my experience most teams do not customize their project build files so for them the default template will suffice.

If you do want to make changes to your Build process you no longer have to edit a confusing poorly documented XML file. Instead when you open the build template in VS you will be presented with a Windows Workflow editor that allows you to edit your build process template.

image

So why did I start this Blog post with a question? Although it does appear to be easier to add functionality to your build process, For those of us who are Windows Workflow challenged there is some learning to do. The good news is it will be better documented and ultimately easier to find solutions.