-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
ref.proj
92 lines (81 loc) · 4.04 KB
/
ref.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
<Project Sdk="Microsoft.Build.Traversal">
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />
<PropertyGroup>
<TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<_allRef Include="$(MSBuildThisFileDirectory)*\ref\*.csproj"
Exclude="@(ProjectExclusions)" />
<NonNetCoreAppProject Include="@(_allRef)"
Exclude="@(NetCoreAppLibrary->'%(Identity)\ref\%(Identity).csproj')" />
<NetCoreAppProject Include="@(_allRef)"
Exclude="@(NonNetCoreAppProject)" />
<GeneratedShimProject Include="shims\generated\*.csproj"
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="@(NetCoreAppProject)" />
<!-- Restore only and build later. -->
<ProjectReference Include="@(NonNetCoreAppProject);
@(GeneratedShimProject)"
Condition="'$(MSBuildRestoreSessionId)' != ''" />
</ItemGroup>
<Target Name="BuildGeneratedShims"
AfterTargets="Build"
Condition="'@(GeneratedShimProject)' != ''">
<MSBuild Targets="Build"
Projects="@(GeneratedShimProject)"
Properties="$(TraversalGlobalProperties)" />
</Target>
<Target Name="GetRefPackFiles">
<ItemGroup>
<RefPackLibFile Include="$(MicrosoftNetCoreAppRefPackRefDir)*.*">
<TargetPath>ref/$(NetCoreAppCurrent)</TargetPath>
<IsSymbolFile Condition="$([System.String]::Copy('%(Identity)').EndsWith('pdb'))">true</IsSymbolFile>
</RefPackLibFile>
</ItemGroup>
<!-- We need to set this metadata in a separate ItemGroup than when the Items are initially populated in order to
have access to the Extension metadata. -->
<ItemGroup>
<RefPackLibFile>
<IsSymbolFile Condition="'%(Extension)' == '.pdb'">true</IsSymbolFile>
</RefPackLibFile>
</ItemGroup>
</Target>
<!-- Generate the ref pack's FrameworkList.xml -->
<UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(DotNetSharedFrameworkTaskFile)"/>
<Target Name="GenerateFrameworkListFile"
DependsOnTargets="GetRefPackFiles"
AfterTargets="BuildGeneratedShims"
Inputs="@(RefPackLibFile)"
Outputs="$(MicrosoftNetCoreAppRefPackDataDir)FrameworkList.xml"
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<ItemGroup>
<FrameworkListRootAttribute Include="Name" Value="$(NetCoreAppCurrentBrandName)" />
<FrameworkListRootAttribute Include="TargetFrameworkIdentifier" Value="$(NetCoreAppCurrentIdentifier)" />
<FrameworkListRootAttribute Include="TargetFrameworkVersion" Value="$(NetCoreAppCurrentVersion)" />
<FrameworkListRootAttribute Include="FrameworkName" Value="$(MicrosoftNetCoreAppFrameworkName)" />
</ItemGroup>
<CreateFrameworkListFile Files="@(RefPackLibFile)"
TargetFile="$(MicrosoftNetCoreAppRefPackDataDir)FrameworkList.xml"
TargetFilePrefixes="ref/;runtimes/"
RootAttributes="@(FrameworkListRootAttribute)" />
</Target>
<Target Name="BuildNonNetCoreAppProjects"
AfterTargets="GenerateFrameworkListFile">
<MSBuild Targets="Build"
BuildInParallel="true"
Projects="@(NonNetCoreAppProject)"
Properties="$(TraversalGlobalProperties)" />
</Target>
<!-- Build generated shims with the full reference closure, including OOB assemblies. -->
<Target Name="RebuildGeneratedShims"
AfterTargets="BuildNonNetCoreAppProjects"
Condition="'@(GeneratedShimProject)' != ''">
<MSBuild Targets="Build"
Projects="@(GeneratedShimProject)"
Properties="$(TraversalGlobalProperties);_Incremental=true" />
</Target>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />
</Project>