TFS: Building solutions with multiple configurations

▼魔方 西西 提交于 2019-12-04 04:22:37

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/24819397/tfs-building-solutions-with-multiple-configurations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!