Merge pull request #23052 from CarolEidt/Fix22850
[platform/upstream/coreclr.git] / tests / dir.traversal.targets
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
4   <Target Name="BuildAllProjects">
5     <PropertyGroup>
6       <DefaultBuildAllTarget Condition="'$(DefaultBuildAllTarget)'==''">$(MSBuildProjectDefaultTargets)</DefaultBuildAllTarget>
7     </PropertyGroup>
8
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)"
12              Projects="@(Project)"
13              Condition="'$(SerializeProjects)'=='true'"
14              Properties="Dummy=%(Identity);DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true"
15              ContinueOnError="ErrorAndContinue" />
16
17     <MSBuild Targets="$(DefaultBuildAllTarget)"
18              Projects="@(Project)"
19              Condition="'$(SerializeProjects)'!='true'"
20              Properties="DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true"
21              BuildInParallel="true"
22              ContinueOnError="ErrorAndContinue" />
23
24     <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
25     <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
26   </Target>
27
28   <Target Name="CleanAllProjects">
29     <PropertyGroup>
30       <DefaultCleanAllTarget Condition="'$(DefaultCleanAllTarget)'==''">Clean</DefaultCleanAllTarget>
31     </PropertyGroup>
32
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)"
36              Projects="@(Project)"
37              Condition="'$(SerializeProjects)'=='true'"
38              Properties="Dummy=%(Identity);CleanAllProjects=true"
39              ContinueOnError="ErrorAndContinue" />
40
41     <MSBuild Targets="$(DefaultCleanAllTarget)"
42              Projects="@(Project)"
43              Condition="'$(SerializeProjects)'!='true'"
44              Properties="CleanAllProjects=true"
45              BuildInParallel="true"
46              ContinueOnError="ErrorAndContinue" />
47
48     <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
49     <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
50   </Target>
51
52   <Target Name="RestoreAllProjectPackages">
53     <Message Importance="High" Text="Restoring project packages..." />
54
55     <PropertyGroup>
56       <DefaultRestoreAllPackagesTarget Condition="'$(DefaultRestoreAllPackagesTarget)'==''">RestorePackages</DefaultRestoreAllPackagesTarget>
57     </PropertyGroup>
58
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)"
62              Projects="@(Project)"
63              Condition="'$(SerializeProjects)'=='true'"
64              Properties="Dummy=%(Identity);RestoreAllPackages=true"
65              ContinueOnError="ErrorAndContinue" />
66
67     <MSBuild Targets="$(DefaultRestoreAllPackagesTarget)"
68              Projects="@(Project)"
69              Condition="'$(SerializeProjects)'!='true'"
70              Properties="RestoreAllPackages=true"
71              BuildInParallel="true"
72              ContinueOnError="ErrorAndContinue" />
73
74     <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
75     <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
76   </Target>
77
78   <PropertyGroup>
79     <TraversalBuildDependsOn>
80       BuildAllProjects;
81       $(TraversalBuildDependsOn);
82     </TraversalBuildDependsOn>
83
84     <TraversalCleanDependsOn>
85       CleanAllProjects;
86       $(TraversalCleanDependsOn);
87     </TraversalCleanDependsOn>
88
89     <TraversalRestorePackagesDependsOn>
90       RestoreAllProjectPackages;
91       $(TraversalRestorePackagesDependsOn)
92     </TraversalRestorePackagesDependsOn>
93   </PropertyGroup>
94
95   <Target Name="Build" DependsOnTargets="$(TraversalBuildDependsOn)" />
96
97   <Target Name="Clean" DependsOnTargets="$(TraversalCleanDependsOn)" />
98
99   <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
100
101   <Target Name="RestorePackages" DependsOnTargets="$(TraversalRestorePackagesDependsOn)" />
102
103 </Project>