This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/
NETStandard.Library.NETFramework.common.targets
64 lines (59 loc) · 3.51 KB
/
NETStandard.Library.NETFramework.common.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Choose>
<!-- Allow completely disabling the conflict resolution targets-->
<When Condition="'$(ImplicitlyExpandNETStandardFacades)' != 'true'" />
<!-- Condition here is a hack until https://github.com/dotnet/sdk/issues/534 is fixed -->
<When Condition="'$(TargetFramework)' != '' or '$(TargetFrameworks)' != ''">
<!-- NuGet 4, run after references are resolved -->
<PropertyGroup>
<ImplicitlyExpandNETStandardFacadesAfter>ResolveLockFileReferences</ImplicitlyExpandNETStandardFacadesAfter>
</PropertyGroup>
</When>
<When Condition="'$(ResolveNuGetPackages)' == 'true' and Exists('$(ProjectLockFile)')">
<!-- NuGet 3, run after nuget assets are resolved -->
<PropertyGroup>
<ImplicitlyExpandNETStandardFacadesAfter>ResolveNuGetPackageAssets</ImplicitlyExpandNETStandardFacadesAfter>
</PropertyGroup>
</When>
<Otherwise>
<!-- NuGet 2, run before targets that consume references -->
<PropertyGroup>
<ResolveAssemblyReferencesDependsOn>ImplicitlyExpandNETStandardFacades;$(ResolveAssemblyReferencesDependsOn)</ResolveAssemblyReferencesDependsOn>
<PrepareResourcesDependsOn>ImplicitlyExpandNETStandardFacades;$(PrepareResourcesDependsOn)</PrepareResourcesDependsOn>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup Condition="'$(ImplicitlyExpandNETStandardFacades)' == 'true'">
<!-- Ensure this runs before conflict resolution since the added files may cause conflicts -->
<HandlePackageFileConflictsDependsOn>ImplicitlyExpandNETStandardFacades;$(HandlePackageFileConflictsDependsOn)</HandlePackageFileConflictsDependsOn>
</PropertyGroup>
<ItemGroup Condition="'$(DontTrimNETStandardLibraryNETFramework)' != 'true'">
<!-- mark this package as trimmable so that files in the same package aren't automatically rooted -->
<TrimmablePackages Include="NETStandard.Library.NETFramework" />
</ItemGroup>
<Target Name="ImplicitlyExpandNETStandardFacades"
AfterTargets="$(ImplicitlyExpandNETStandardFacadesAfter)">
<ItemGroup>
<!-- Remove simple name references if we're directly providing a reference assembly to the compiler. For example,
consider a project with an Reference Include="System", and some NuGet package is providing System.dll.
Simple references can also come from NuGet framework assemblies, hence this statement should occur after
including all computed references. -->
<Reference Remove="%(_NETStandardLibraryNETFrameworkReference.FileName)" />
<Reference Include="@(_NETStandardLibraryNETFrameworkReference)">
<!-- Private = false to make these reference only -->
<Private>false</Private>
<NuGetPackageId>NETStandard.Library.NETFramework</NuGetPackageId>
<NuGetPackageVersion>$(NETStandardLibraryNETFrameworkPackageVersion)</NuGetPackageVersion>
<NuGetIsFrameworkReference>false</NuGetIsFrameworkReference>
<NuGetSourceType>Package</NuGetSourceType>
</Reference>
<ReferenceCopyLocalPaths Include="@(_NETStandardLibraryNETFrameworkLib)">
<Private>false</Private>
<NuGetPackageId>NETStandard.Library.NETFramework</NuGetPackageId>
<NuGetPackageVersion>$(NETStandardLibraryPackageVersion)</NuGetPackageVersion>
<NuGetIsFrameworkReference>false</NuGetIsFrameworkReference>
<NuGetSourceType>Package</NuGetSourceType>
</ReferenceCopyLocalPaths>
</ItemGroup>
</Target>
</Project>