-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
oob.proj
108 lines (91 loc) · 5.89 KB
/
oob.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)-$(TargetOS)</TargetFramework>
<!-- By default, build the NetCoreAppCurrent vertical only. -->
<BuildTargetFramework Condition="'$(BuildAllConfigurations)' != 'true'">$(NetCoreAppCurrent)</BuildTargetFramework>
</PropertyGroup>
<ItemGroup Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<ProjectReference Include="sfx-src.proj" OutputItemType="SharedFrameworkAssembly" />
<ProjectReference Include="oob-src.proj" OutputItemType="OOBAssembly" />
<ProjectReference Include="shims.proj" OutputItemType="SharedFrameworkAssembly" />
<ProjectReference Include="apicompat\ApiCompat.proj"
Condition="'$(DotNetBuildFromSource)' != 'true' and '$(RunApiCompat)' != 'false'" />
</ItemGroup>
<ItemGroup Condition="'$(BuildTargetFramework)' != '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<ProjectReference Include="oob-all.proj" SkipGetTargetFrameworkProperties="true" />
</ItemGroup>
<!-- Support building reference projects only. -->
<ItemGroup Condition="'$(RefOnly)' == 'true'">
<ProjectReference Remove="@(ProjectReference)" />
<ProjectReference Include="sfx-ref.proj" OutputItemType="SharedFrameworkAssembly" />
<ProjectReference Include="oob-ref.proj" />
<ProjectReference Include="shims.proj" OutputItemType="SharedFrameworkAssembly" />
</ItemGroup>
<ImportGroup Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<!-- Re-generate the targeting pack's framework list to include shims. -->
<Import Project="frameworklist.targets" />
<!-- Import the illink file which contains some of the logic required to illink the out-of-band assemblies. -->
<Import Project="$(RepositoryEngineeringDir)illink.targets" />
</ImportGroup>
<Target Name="GetTrimOOBAssembliesInputs"
DependsOnTargets="ResolveProjectReferences">
<PropertyGroup>
<OOBAssembliesTrimmedArtifactsPath>$([MSBuild]::NormalizeDirectory('$(ILLinkTrimAssemblyArtifactsRootDir)', 'trimmed-oobs'))</OOBAssembliesTrimmedArtifactsPath>
<OOBAssembliesMarkerFile>$(IntermediateOutputPath)linker-$(TargetArchitecture)-marker.txt</OOBAssembliesMarkerFile>
</PropertyGroup>
<ItemGroup>
<!-- Include suppression XML files bin-placed in earlier per-library linker run. -->
<OOBLibrarySuppressionsXml Include="$(ILLinkTrimAssemblyOOBSuppressionsXmlsDir)*.xml" />
<!-- The following is the list of all the OOBs we will ignore for now -->
<OOBAssemblyToIgnore Include="System.CodeDom;
System.ComponentModel.Composition;
System.ComponentModel.Composition.Registration;
System.Composition.AttributedModel;
System.Composition.Convention;
System.Composition.Hosting;
System.Composition.Runtime;
System.Composition.TypedParts;
System.Configuration.ConfigurationManager;
System.Speech;
Microsoft.Extensions.DependencyInjection.Specification.Tests" />
<!-- Move items to FileName so that we can subtract them. -->
<OOBAssemblyWithFilename Include="@(OOBAssembly->Metadata('Filename'))"
OriginalIdentity="%(Identity)" />
<OOBAssemblyToTrimWithFilename Include="@(OOBAssemblyWithFilename)"
Exclude="@(OOBAssemblyToIgnore)" />
<OOBAssemblyToIgnoreWithFilename Include="@(OOBAssemblyWithFilename)"
Exclude="@(OOBAssemblyToTrimWithFilename)" />
<OOBAssemblyToTrim Include="@(OOBAssemblyToTrimWithFilename->Metadata('OriginalIdentity'))" />
<OOBAssemblyReference Include="@(OOBAssemblyToIgnoreWithFilename->Metadata('OriginalIdentity'));
@(SharedFrameworkAssembly)" />
</ItemGroup>
</Target>
<Target Name="TrimOOBAssemblies"
AfterTargets="Build"
Condition="'$(RefOnly)' != 'true' and '@(OOBAssembly)' != ''"
DependsOnTargets="GetTrimOOBAssembliesInputs;PrepareForAssembliesTrim"
Inputs="$(ILLinkTasksAssembly);@(OOBAssemblyToTrim);@(OOBAssemblyReference);@(OOBLibrarySuppressionsXml)"
Outputs="$(OOBAssembliesMarkerFile)">
<Message Text="$(MSBuildProjectName) -> Trimming $(PackageRID) out-of-band assemblies with ILLinker..." Importance="high" />
<PropertyGroup>
<OOBILLinkArgs>$(ILLinkArgs)</OOBILLinkArgs>
<OOBILLinkArgs Condition="'@(OOBLibrarySuppressionsXml)' != ''" >$(OOBILLinkArgs) --link-attributes "@(OOBLibrarySuppressionsXml->'%(FullPath)', '" --link-attributes "')"</OOBILLinkArgs>
</PropertyGroup>
<ILLink AssemblyPaths=""
RootAssemblyNames="@(OOBAssemblyToTrim)"
ReferenceAssemblyPaths="@(OOBAssemblyReference)"
OutputDirectory="$(OOBAssembliesTrimmedArtifactsPath)"
ExtraArgs="$(OOBILLinkArgs)"
ToolExe="$(_DotNetHostFileName)"
ToolPath="$(_DotNetHostDirectory)" />
<!-- Create a marker file which serves as the target's output to enable incremental builds. -->
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName('$(OOBAssembliesMarkerFile)'))" />
<Touch Files="$(OOBAssembliesMarkerFile)"
AlwaysCreate="true" />
</Target>
<Target Name="SetAzureDevOpsVariableForBuiltPackages"
Condition="'$(ContinuousIntegrationBuild)' == 'true'"
AfterTargets="Build;Pack">
<Message Condition="Exists('$(ArtifactsDir)packages')" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
</Target>
</Project>