views:

6

answers:

0

The Goal:

New Team Projects should point to a centralized (custom) Build Process Template which my team maintains and makes occasional updates to. These updates should apply to all projects which use the template, so we need those projects to point to the centralized version of the template, not a copy which is local to the project.

What I have already tried:

Update new projects manually.
After a new Team Project is created, I can ask the team to manually reference the centralized Build Process Template by clicking the Process Tab, expanding the Process Template section, clicking "New..." and navigating to the public Source Control path where we have published the default template. This is a problem because I am supporting an internal IT department with dozens of teams and a couple hundred developers, with several new projects spinning up each month. It is a process that is just infrequent enough for any given team that I would have to provide a "refresher" every time that team started a new project, but frequent enough for the whole organization that I would be constantly providing [re-]training until every team had gone through the process a few times.

Modify the Process Template for the Team Project Collection to point to the shared location for the custom Build Process Template.
I downloaded the default project template for the team collection (in our case, it's the out-of-the-box MSF for Agile Software Development v5.0) and modified the Build plug-in's XML to point the default template's ServerPath to the shared location:

<ProcessTemplate Type="Default" 
      Filename="Build\Templates\StackDefaultTemplate.xaml"
      ServerPath="$/Shared/BuildProcessTemplates" />

instead of the "tokenized"

<ProcessTemplate Type="Default" 
      Filename="Build\Templates\DefaultTemplate.xaml"
      ServerPath="$/$$PROJECTNAME$$/BuildProcessTemplates" />

Although the modified process template is validated and uploads to TFS without any error, this is a problem because when a new project is created the Build plug-in fails with an exception that the template already exists. I also tried modifying or removing the Filename to see whether that would prevent TFS from trying to upload a new Build Process Template file instead of using my existing template, but in that case the template validation fails and cannot be uploaded.

Write my own Build Plug-in for the Process Template
Since the default Build plug-in is coded to always create a new copy of the Build Process Template file, I thought maybe I could write my own plug-in to correctly modify the new project. This is a problem because while there is documentation on customizing the built-in plugins using XML files, there is no indication in the documentation that the plug-in architecture was actually intended to be extended to custom plug-ins. I did spend some time in Reflector studying the scope and functionality of the shipped Build plug-in, as well as the plug-in architecture in the TeamFoundation DLLs, and I think I have a grasp of what it will take to write my own plug-in, but I want to make sure that there are no better solutions before I start down that dimly-lit path. With Reflector output being my only documentation, it seems like a risky undertaking.

I am willing to try any good suggestions, and would be especially interested to hear whether others have tried to implement anything like this!