corert/dir.traversal.targets

61 строка
2.4 KiB
XML

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="BuildAllProjects">
<PropertyGroup>
<DefaultBuildAllTarget Condition="'$(DefaultBuildAllTarget)'==''">$(MSBuildProjectDefaultTargets)</DefaultBuildAllTarget>
</PropertyGroup>
<!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity
however since the project names are unique it will essentially force each to run in its own batch -->
<MSBuild Targets="$(DefaultBuildAllTarget)"
Projects="@(Project)"
Condition="'$(SerializeProjects)'=='true' AND '%(Identity)' != ''"
Properties="DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true"
ContinueOnError="ErrorAndContinue" />
<MSBuild Targets="$(DefaultBuildAllTarget)"
Projects="@(Project)"
Condition="'$(SerializeProjects)'!='true'"
Properties="DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true"
BuildInParallel="true"
ContinueOnError="ErrorAndContinue" />
<!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
<Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
</Target>
<Target Name="RestoreAllProjects">
<Message Importance="High" Text="Restoring project packages..." />
<PropertyGroup>
<DefaultRestoreAllTarget Condition="'$(DefaultRestoreAllTarget)'==''">Restore</DefaultRestoreAllTarget>
</PropertyGroup>
<!-- Forcing BuildInParallel=false. BuildInParallel=true clashes with nuget task parallel restore -->
<MSBuild Targets="$(DefaultRestoreAllTarget)"
Projects="@(Project)"
BuildInParallel="false"
ContinueOnError="ErrorAndContinue" />
<!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
<Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
</Target>
<PropertyGroup>
<TraversalBuildDependsOn>
BuildAllProjects;
$(TraversalBuildDependsOn);
</TraversalBuildDependsOn>
<TraversalRestoreDependsOn>
RestoreAllProjects;
$(TraversalRestoreDependsOn)
</TraversalRestoreDependsOn>
</PropertyGroup>
<Target Name="Build" DependsOnTargets="$(TraversalBuildDependsOn)" />
<Target Name="Restore" DependsOnTargets="$(TraversalRestoreDependsOn)" />
</Project>