forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSubsetValidation.targets
46 lines (36 loc) · 2.12 KB
/
SubsetValidation.targets
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
<Project InitialTargets="FindInvalidSpecifiedSubsetNames;ReportValidSubsetList">
<!--
The imported file supports the '/p:Subset=<desired subset string>' dev build argument.
Each subset has its own '<subset>Project' 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
-->
<Target Name="FindInvalidSpecifiedSubsetNames">
<ItemGroup>
<SpecifiedSubsetName Include="$([MSBuild]::Unescape($(Subset.Replace('+', ';').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="- %(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="This is not an error. These are the available subsets. You can choose one or none at all for a full build."
Condition="'$(UserRequestedHelp)' == 'true'" />
</Target>
</Project>