forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.proj
79 lines (66 loc) · 3.19 KB
/
Build.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<Project Sdk="Microsoft.Build.Traversal">
<!--
Subsets are already imported by Directory.Build.props.
Reference the projects for traversal build. Ordering matters here.
-->
<ItemGroup>
<ProjectReference Include="@(CoreClrProject)" />
<ProjectReference Include="@(MonoProject)" />
<ProjectReference Include="@(LibrariesProject)" />
<ProjectReference Include="@(InstallerProject)" />
</ItemGroup>
<!--
Exclude installer depproj and pkgproj from static graph restore. We restore them below.
Remove when https://github.com/NuGet/Home/issues/9398 is fixed.
-->
<ItemGroup Condition="'$(MSBuildRestoreSessionId)' != ''">
<ProjectReference Remove="@(DepprojProjectToBuild)" />
<ProjectReference Remove="@(PkgprojProjectToBuild)" />
<ProjectReference Remove="@(BundleProjectToBuild)" />
</ItemGroup>
<!-- Custom arcade target which isn't available in Microsoft.Build.Traversal. -->
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
<Import Project="$(RepositoryEngineeringDir)SubsetValidation.targets" />
<!-- Upfront restore hooks -->
<Import Project="$(RepositoryEngineeringDir)restore\docs.targets" Condition="'$(DotNetBuildFromSource)' != 'true'" />
<Import Project="$(RepositoryEngineeringDir)restore\optimizationData.targets" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(EnableNgenOptimization)' == 'true'" />
<!--
Use synthetic inputs/outputs to avoid building it all the time. This should let devs build with
MSBuild node reuse enabled (the Arcade default). If it were built every time, it would hit file
locking issues vs. the persistent nodes that loaded the task DLL for the previous build. It
isn't particularly accurate, but better than nothing.
-->
<Target Name="BuildRepoTasks"
DependsOnTargets="GetRepoTasksSrc"
BeforeTargets="Restore"
Inputs="@(RepoTasksSrc)"
Outputs="$(RepoTasksOutputFile)">
<ItemGroup>
<RepoTaskProjects Include="$(RepoTasksDir)**\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(RepoTaskProjects)"
Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid());Configuration=Debug;Platform=AnyCPU"
Targets="Restore"/>
<MSBuild Projects="@(RepoTaskProjects)"
Properties="Configuration=Debug;Platform=AnyCPU"
Targets="Build"/>
<WriteLinesToFile File="$(RepoTasksOutputFile)"
Lines="$(RepoTasksOutputFile)"
Overwrite="true" />
</Target>
<Target Name="GetRepoTasksSrc">
<PropertyGroup>
<RepoTasksDir>$(RepoTasksDir)</RepoTasksDir>
<RepoTasksOutputFile>$(ArtifactsObjDir)runtime.tasks\Debug\build-semaphore.txt</RepoTasksOutputFile>
</PropertyGroup>
<ItemGroup>
<RepoTasksSrc Include="$(RepoTasksDir)**\*.cs*" />
</ItemGroup>
</Target>
<Target Name="RestoreWithoutStaticGraph"
BeforeTargets="Restore">
<MSBuild Projects="@(LibrariesRestoreProject);@(DepprojProjectToBuild);@(PkgprojProjectToBuild);@(BundleProjectToBuild)"
Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid());RestoreUseStaticGraphEvaluation=false"
Targets="Restore" />
</Target>
</Project>