1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4 <Target Name="BuildAllProjects">
6 <DefaultBuildAllTarget Condition="'$(DefaultBuildAllTarget)'==''">$(MSBuildProjectDefaultTargets)</DefaultBuildAllTarget>
9 <!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity
10 however since the project names are unique it will essentially force each to run in its own batch -->
11 <MSBuild Targets="$(DefaultBuildAllTarget)"
13 Condition="'$(SerializeProjects)'=='true'"
14 Properties="Dummy=%(Identity);DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true"
15 ContinueOnError="ErrorAndContinue" />
17 <MSBuild Targets="$(DefaultBuildAllTarget)"
19 Condition="'$(SerializeProjects)'!='true'"
20 Properties="DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true"
21 BuildInParallel="true"
22 ContinueOnError="ErrorAndContinue" />
24 <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
25 <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
28 <Target Name="CleanAllProjects">
30 <DefaultCleanAllTarget Condition="'$(DefaultCleanAllTarget)'==''">Clean</DefaultCleanAllTarget>
33 <!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity
34 however since the project names are unique it will essentially force each to run in its own batch -->
35 <MSBuild Targets="$(DefaultCleanAllTarget)"
37 Condition="'$(SerializeProjects)'=='true'"
38 Properties="Dummy=%(Identity);CleanAllProjects=true"
39 ContinueOnError="ErrorAndContinue" />
41 <MSBuild Targets="$(DefaultCleanAllTarget)"
43 Condition="'$(SerializeProjects)'!='true'"
44 Properties="CleanAllProjects=true"
45 BuildInParallel="true"
46 ContinueOnError="ErrorAndContinue" />
48 <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
49 <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
52 <Target Name="RestoreAllProjectPackages">
53 <Message Importance="High" Text="Restoring project packages..." />
56 <DefaultRestoreAllPackagesTarget Condition="'$(DefaultRestoreAllPackagesTarget)'==''">RestorePackages</DefaultRestoreAllPackagesTarget>
59 <!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity
60 however since the project names are unique it will essentially force each to run in its own batch -->
61 <MSBuild Targets="$(DefaultRestoreAllPackagesTarget)"
63 Condition="'$(SerializeProjects)'=='true'"
64 Properties="Dummy=%(Identity);RestoreAllPackages=true"
65 ContinueOnError="ErrorAndContinue" />
67 <MSBuild Targets="$(DefaultRestoreAllPackagesTarget)"
69 Condition="'$(SerializeProjects)'!='true'"
70 Properties="RestoreAllPackages=true"
71 BuildInParallel="true"
72 ContinueOnError="ErrorAndContinue" />
74 <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
75 <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
79 <TraversalBuildDependsOn>
81 $(TraversalBuildDependsOn);
82 </TraversalBuildDependsOn>
84 <TraversalCleanDependsOn>
86 $(TraversalCleanDependsOn);
87 </TraversalCleanDependsOn>
89 <TraversalRestorePackagesDependsOn>
90 RestoreAllProjectPackages;
91 $(TraversalRestorePackagesDependsOn)
92 </TraversalRestorePackagesDependsOn>
95 <Target Name="Build" DependsOnTargets="$(TraversalBuildDependsOn)" />
97 <Target Name="Clean" DependsOnTargets="$(TraversalCleanDependsOn)" />
99 <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
101 <Target Name="RestorePackages" DependsOnTargets="$(TraversalRestorePackagesDependsOn)" />