【发布时间】:2011-04-29 11:05:21
【问题描述】:
我会布置场景:
- 我们有一个 TFS 构建 .proj,它依次构建 3 个依赖项解决方案。
- 然后它会并行构建大约 100 个不相关的解决方案。
这在 .net 3.5 下似乎可以正常工作,但是自从我们移至 4.0 后,似乎依赖解决方案是并行构建的,这会导致问题。
我总是可以做一个
<Exec Command="C:\PATH\TO\MSBUILD SOLUTION1"><Exec Command="C:\PATH\TO\MSBUILD SOLUTION2"><Exec Command="C:\PATH\TO\MSBUILD SOLUTION3">
等等,但这似乎有点乱。
所以我的问题是:我如何告诉 MSBUILD 按顺序构建一些解决方案,然后并行构建其他负载?
(我们当前的构建模式如下)
<ItemGroup>
<SolutionToBuild0 Include="$(SolutionRoot)\Solutions\MSBuildTasks\MSbuildTasks.sln"/>
<SolutionToBuild1 Include="$(SolutionRoot)\Solutions\Level1\Level1.sln" />
<SolutionToBuild2 Include="$(SolutionRoot)\Solutions\Level2\Level2.sln" />
<SolutionToBuild3 Include="$(SolutionRoot)\Solutions\xxx.Reporting\xxx.Reporting.sln />
</ItemGroup>
<MSBuild Projects="@(SolutionToBuild0)" Targets="Build" Properties="TeamBuildConstants=$(TeamBuildConstants)" BuildInParallel="false" />
<MSBuild Projects="@(SolutionToBuild1)" Targets="Build" Properties="TeamBuildConstants=$(TeamBuildConstants)" BuildInParallel="false" />
<MSBuild Projects="@(SolutionToBuild2)" Targets="Build" Properties="TeamBuildConstants=$(TeamBuildConstants)" BuildInParallel="false" />
<MSBuild Projects="@(SolutionToBuild3)" Targets="Build" Properties="TeamBuildConstants=$(TeamBuildConstants)" BuildInParallel="false" />
<SolutionToBuild Include="$(SolutionRoot)\Solutions\xxx.LocationImporter\xxx.LocationImporter.sln" />
<SolutionToBuild Include="$(SolutionRoot)\xxx\Dev\Source\server_and_common2008.sln" />
`
【问题讨论】: