-->

How to make build definition in TFS Build 2010 con

2019-07-17 19:03发布

问题:

We are using TFS Build 2010 for Builds. We have two branches of source code (Lets say branchA and branchB).

Now as a part of the build definition we set the projects to build:

Now to employ the same build definition from branchB will mean that I create another build definition file with same content, with only the items to build set to "$/branchB"

Is there anyway to make this configurable, without having to edit the build definition?

Also there are other input variables that we set for the build definition, and the values for these variables are included in the build definition XAML file. So to change the value of a variable will mean that we have to edit the build definition XAML file. This is not desirable.

I would like to be able to set the "Items to Build" and the variables of the build definition without having to modify the build definition XAML file.

Are there any solutions to these problems?

回答1:

You can modify the Build Process Template so it only asks you for the Items to Build. The rest of the arguments are prefilled. To get an idea how this works, see http://www.ewaldhofman.nl/?tag=/build+2010+customization



回答2:

You can add parameters to your build definition. I did this a while back because we had two web projects in a solution that had to be deployed to different servers (via Windows shares). I added parameters to the build def so that in the build properties I could customize them depending on if it was a dev deployment, staging, etc.

I added a blog post on how to do it. You can use the parameters this way so that they aren't kept in the XAML file.

Deploying Web Apps with a customized Build Process in TFS