How to build 2 solutions from a single TFS team build definition

邮差的信 提交于 2019-12-22 18:29:34

问题


I have a pretty large complicated application that has a smart client front end in one solution and a web services layer in another solution. We use 2 team build definitions in TFS 2010 to build the solutions. We are still using MS Build scripts not the new workflow based templates.

How can we use a single build definition to build both solutions. We are open to either tricks inside MS Build scripts or moving to the new workflow templates.


回答1:


You can simply set two Solutions to build by creating them in an item group if I am understanding what you are trying to do

    <SolutionToBuild Include="$(BuildProjectFolderPath)/../../$(SuiteSourceBranchRoot)/MyCompany.Suite.sln">
      <Targets></Targets>
      <Properties></Properties>
    </SolutionToBuild>
    <SolutionToBuild Include="$(BuildProjectFolderPath)/../../$(SuiteSourceBranchRoot)/MyCompany.Another.sln">
      <Targets></Targets>
      <Properties></Properties>
    </SolutionToBuild>
  </ItemGroup>

You can also do it inside any build step with:

<!-- Build the deployment solution. -->
<MSBuild Projects="$(SolutionRoot)\$(SuiteSourceBranchRoot)/Company.Deployment.sln" Properties="Configuration=Release;" />



回答2:


You can build multiple solutions from a single team build project definition by definitng multiple SolutionToBuild items in your TFSBuild.proj MSBuild project file.

<ItemGroup>
  <SolutionToBuild Include="$(SolutionRoot)\A\A.sln" />
  <SolutionToBuild Include="$(SolutionRoot)\B\B.sln" />
</ItemGroup>

You may also have to modify the build definition's workspace mapping to include sources for both solutions.



来源:https://stackoverflow.com/questions/6431177/how-to-build-2-solutions-from-a-single-tfs-team-build-definition

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