forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.props
98 lines (78 loc) · 4.06 KB
/
Build.props
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<Project>
<!--
Import projects for Arcade to build.
The imported file supports the '/p:Subset=<desired subset string>' dev build argument.
Each subset has its own '<subset>ProjectToBuild' items so that a project in the build can depend
on a whole subset, and the dependency on the subset is disregarded automatically when Subset
doesn't contain it.
%(ProjectToBuild.SignPhase): Indicates this project must be built before a certain signing
phase. Projects can depend on 'signing/stages/Sign<stage>.proj' to wait until all projects
that are part of a stage are complete. This allows the build to perform complex container
signing that isn't (can't be?) supported by Arcade's single pass, such as MSIs and bundles:
https://github.com/dotnet/arcade/issues/388
-->
<Import Project="$(MSBuildThisFileDirectory)Configurations.props" />
<Import Project="$(MSBuildThisFileDirectory)Subsets.props" />
<Target Name="CheckSpecifiedSubsetValidity"
DependsOnTargets="FindInvalidSpecifiedSubsetNames;ReportValidSubsetList"
BeforeTargets="Execute" />
<Target Name="FindInvalidSpecifiedSubsetNames">
<ItemGroup>
<SpecifiedSubsetName Include="$([MSBuild]::Unescape($(Subset.Replace('-', ';'))))" />
<!-- MSBuild Exclude is case-insensitive, which matches intended behavior. -->
<InvalidSpecifiedSubsetName Include="@(SpecifiedSubsetName)" Exclude="@(SubsetName)" />
</ItemGroup>
<PropertyGroup>
<UserRequestedHelp Condition="'%(InvalidSpecifiedSubsetName.Identity)' == 'help'">true</UserRequestedHelp>
</PropertyGroup>
</Target>
<Target Name="ReportValidSubsetList"
Condition="'@(InvalidSpecifiedSubsetName)' != ''">
<ItemGroup>
<SubsetName Text="- " />
<SubsetName Condition="'%(Category)' != ''" Text="%(Text)%(Category)|" />
<SubsetName Text="%(Text)%(Identity)" />
<SubsetName Text="%(Text) [only runs on demand]" Condition="'%(SubsetName.OnDemand)' == 'true'" />
<SubsetName Text="%(Text)%0A %(Description)" />
</ItemGroup>
<Message Text="%0AAccepted Subset values:%0A@(SubsetName->'%(Text)', '%0A')%0A" Importance="High" />
<Error Text="Subset not recognized: @(InvalidSpecifiedSubsetName, ' ')"
Condition="'$(UserRequestedHelp)' != 'true'" />
<Error Text="Choose a subset to use, or do not specify a subset to perform the full build."
Condition="'$(UserRequestedHelp)' == 'true'" />
</Target>
<!--
Use this extensibility point to build custom tasks during Build.proj, before any restoring or
building happens in the repo. These DLLs would ideally live in Arcade and be restored as tools,
so the idea is building them here is somewhat equivalent.
Also create the host RID props file so the main build can use it statically.
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="Execute"
Inputs="@(RepoTasksSrc)"
Outputs="$(RepoTasksOutputFile)">
<ItemGroup>
<RepoTaskProjects Include="$(RepoTasksDir)**\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(RepoTaskProjects)"
Properties="Configuration=Debug;Platform=AnyCPU"
Targets="Restore;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>
</Project>