forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsfx.proj
72 lines (60 loc) · 3.58 KB
/
sfx.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
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)-$(TargetOS)</TargetFramework>
<BuildInParallel>false</BuildInParallel>
</PropertyGroup>
<ItemGroup>
<!-- The sfx ref projects must be built first as sfx src projects don't use P2Ps to reference each other. Instead the
references are defined manually via Reference items, therefore the reference assemblies must exist before that. -->
<ProjectReference Include="sfx-ref.proj">
<OutputItemType Condition="'$(RefOnly)' == 'true'">SharedFrameworkAssembly</OutputItemType>
</ProjectReference>
</ItemGroup>
<!-- Support building only the reference assemblies. -->
<ItemGroup Condition="'$(RefOnly)' != 'true'">
<ProjectReference Include="sfx-src.proj" OutputItemType="SharedFrameworkAssembly" />
<ProjectReference Include="sfx-gen.proj" />
</ItemGroup>
<!-- Generate the targeting pack's framework list so that out-of-band projects can leverage it. -->
<Import Project="frameworklist.targets" />
<!-- Import the illink file which contains some of the logic required to illink the shared framework assemblies. -->
<Import Project="$(RepositoryEngineeringDir)illink.targets" />
<Target Name="GetTrimSharedFrameworkAssembliesInputs"
DependsOnTargets="ResolveProjectReferences">
<PropertyGroup>
<SharedFrameworkAssembliesTrimDir>$([MSBuild]::NormalizeDirectory('$(IntermediateOutputPath)', 'illink-$(TargetArchitecture)'))</SharedFrameworkAssembliesTrimDir>
<SharedFrameworkAssembliesTrimMarkerFile>$(SharedFrameworkAssembliesTrimDir)linker-marker.txt</SharedFrameworkAssembliesTrimMarkerFile>
</PropertyGroup>
<ItemGroup>
<SharedFrameworkSuppressionsXml Include="@(SharedFrameworkAssembly->Metadata('ILLinkSuppressionsXmls'))" />
<SharedFrameworkSuppressionsXml Include="$(CoreLibSharedDir)ILLink\ILLink.Suppressions.LibraryBuild.xml" />
</ItemGroup>
</Target>
<Target Name="TrimSharedFrameworkAssemblies"
AfterTargets="Build"
DependsOnTargets="ResolveProjectReferences;GetTrimSharedFrameworkAssembliesInputs;PrepareForAssembliesTrim"
Condition="'$(RefOnly)' != 'true'"
Inputs="@(SharedFrameworkAssembly);@(SharedFrameworkSuppressionsXml);$(ILLinkTasksAssembly)"
Outputs="$(SharedFrameworkAssembliesTrimMarkerFile)">
<Message Text="$(MSBuildProjectName) -> Trimming $(OutputRid) shared framework assemblies with ILLinker..." Importance="high" />
<PropertyGroup>
<SharedFrameworkILLinkArgs>$(ILLinkArgs)</SharedFrameworkILLinkArgs>
<!-- update debug symbols -->
<SharedFrameworkILLinkArgs>$(SharedFrameworkILLinkArgs) -b true</SharedFrameworkILLinkArgs>
<SharedFrameworkILLinkArgs Condition="'@(SharedFrameworkSuppressionsXml)' != ''" >$(SharedFrameworkILLinkArgs) --link-attributes "@(SharedFrameworkSuppressionsXml, '" --link-attributes "')"</SharedFrameworkILLinkArgs>
</PropertyGroup>
<ItemGroup>
<SharedFrameworkAssembly RootMode="library" />
</ItemGroup>
<MakeDir Directories="$(SharedFrameworkAssembliesTrimDir)" />
<ILLink AssemblyPaths=""
RootAssemblyNames="@(SharedFrameworkAssembly)"
OutputDirectory="$(SharedFrameworkAssembliesTrimDir)"
ExtraArgs="$(SharedFrameworkILLinkArgs)"
ToolExe="$(_DotNetHostFileName)"
ToolPath="$(_DotNetHostDirectory)" />
<!-- Create a marker file which serves as the target's output to enable incremental builds. -->
<Touch Files="$(SharedFrameworkAssembliesTrimMarkerFile)"
AlwaysCreate="true" />
</Target>
</Project>