Archive for June, 2014
How to add an enum to a TFS build definition
Recently I was asked how you go about to create an enum/drow-down argument in a TFS build definition. It’s actually a quite easy thing to solve and requires very little code. But it does require a fair bit of plumbing and since I didn’t find an example on how to do this I’m posting the steps here.
This is the scenario: I want a drop-down argument in my build definition that’s bound to an enum value, i.e. let me select the build status from a known set of values:
First add an enum to a TFS build activity:
I’m assuming you’re familiar with the process of TFS build extensibility. If you need an example of how to create a TFS build activity see http://msdn.microsoft.com/en-us/library/hh850441.aspx for an example.
Next add an argument of the BuildStatusEnum type to your build definition:
To get the enum to show as drop-down you need to add metadata to render it correctly. Open the metadata editor in from the Metadata argument and add the BuildStatus argument as a parameter. Then specify Microsoft.TeamFoundation.Build.Controls.EnumPropertyEditor, Microsoft.TeamFoundation.Build.Controls as the Editor, this does the trick of rendering the enum as a drop-down in the build definition process later on. The EnumPropertyEditor is one of the built-in editors which is convenient to use instead of implementing this logic yourself. If you’re curious of what other editors there are then take a look at this post http://bartwullems.blogspot.se/2012/07/tfs-build-using-built-in-editors.html and dig deeper by using a .NET reflection tool to investigate the code.
That’s all you need to do to setup the design time experience, now you can go on and use the enum in the build definition as you intend to.
WitCustomControls for 2013 Update 2 released
We’ve added a 1.2.2.0 release at https://witcustomcontrols.codeplex.com/ to fix an issue caused by changes in the jscript structure in TFS 2013 Update 2.
Release Notes
This release contains the following changes:
- Updated to support TFS 2013 Update 2.
- Bugfix for issue Multi Value Control, Error, Unable to get property ‘clear’ of undefined or null reference https://witcustomcontrols.codeplex.com/workitem/35301.
Download the latest release here: https://witcustomcontrols.codeplex.com/releases/view/123638.
Presentation från “Har du en DevOps i ditt team?” (SWE)
Tack alla som kom, bra diskussioner om ett i mitt tycke viktigt ämne!
Nu finns presentation från seminariet uppe på SlideShare: http://www.slideshare.net/Solidify-Sverige/solidify-dev-ops
Nästa gång kör vi i Göteborg (den 12 september). Passa på att boka dig om du vill komma och lära dig mer om DevOps rollen och hur Visual Studio 2013 ALM hjälper dig bli mer effektiv i teamet. Info och registrering på http://informator.se/seminarier/seminarier/har-du-en-devops-i-ditt-team.