TFS: Building solutions with multiple configuratio

2020-04-10 01:49发布

Scenario: On TFS 2013, I have to build 300+ projects (C# and VC++), divided among, around 40 solutions. Some projects have multiple Release and Debug configurations e.g one project may have 3 Release configurations like Release 1, Release 2, Release 3|x86, Release 4|x64 etc.

Requirement: I'm trying to find TFS feature to build a solution with Release configuration, it should detect all the Release Configurations specified in projects added to that solution, and build all configurations. (Same for Debug).

Question: If this functionality is not built-in and I have to customize TFS Build Definition for these, where should I add these?

2条回答
Rolldiameter
2楼-- · 2020-04-10 02:32

In the build definition you can specify the platforms and configurations you want to build. Open the build definition, goto the process tab.

where you enter the solution to build there is the configurations section (02. Build on 2013) here you can enter your configurations to build.

Platform / Configurations

查看更多
Deceive 欺骗
3楼-- · 2020-04-10 02:32

To collect information from existing .sln/.proj files you have three options:

  1. use MSBuildEmitSolution trick
  2. use some obscure API
  3. parse the files' text

I would suggest the latter: it could break, but it is fast and cheap (trust me, as I tried them all).

You need customize the build template. In TFS 2013 default templates (TfvcTemplate.12.xaml) the MSBuild activity loops through the values stored in the ConfigurationsToBuild argument variable. So, you should add a step to scan the solution/project files (the ones specified in the build definition), collect the desired configuration values and pass them to the MSBuild activity.

To learn how customize the template, look at the ALM Rangers' guidance.

查看更多
登录 后发表回答