|
2 | 2 |
|
3 | 3 | <Import Project="..\..\Directory.Build.targets" />
|
4 | 4 |
|
| 5 | + <!-- netstandard2.0's targeting pack uses the old package reference model which doesn't support using a local layout. |
| 6 | + Therefore disable the package reference download via DisableImplicitFrameworkReferences and manually import the |
| 7 | + packages' targets file to receive the references. --> |
| 8 | + <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> |
| 9 | + <NETStandardLibraryArtifactsDir>$(ArtifactsBinDir)NETStandard.Library.2.0.3\pack\</NETStandardLibraryArtifactsDir> |
| 10 | + <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> |
| 11 | + </PropertyGroup> |
| 12 | + <Import Project="$(NETStandardLibraryArtifactsDir)build\netstandard2.0\NETStandard.Library.targets" Condition="'$(TargetFramework)' == 'netstandard2.0' and '$(ExcludeRestorePackageImports)' != 'true' and Exists('$(NETStandardLibraryArtifactsDir)')" /> |
| 13 | + |
5 | 14 | <PropertyGroup>
|
| 15 | + <EnableTargetingPackDownload>false</EnableTargetingPackDownload> |
| 16 | + <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> |
| 17 | + |
| 18 | + <!-- Avoid transitive framework reference downloads to minimize the number of targeting packs and prebuilts. --> |
| 19 | + <DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads> |
| 20 | + |
6 | 21 | <!-- Disable RAR from transitively discovering dependencies for references. This is required as we don't copy
|
7 | 22 | dependencies over into the output directory which means RAR can't resolve them.
|
8 | 23 | This is also necessary to make P2Ps with same package ids but different versions work. -->
|
|
33 | 48 | <!-- Customization extension point -->
|
34 | 49 | <Import Project="$(CustomizationsPropsPath)" Condition="Exists('$(CustomizationsPropsPath)')" />
|
35 | 50 |
|
36 |
| - <PropertyGroup> |
37 |
| - <!-- Avoid transitive framework reference downloads to minimize the number of targeting packs and prebuilts. --> |
38 |
| - <DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads> |
39 |
| - <!-- The SDK already sets the NETStandardImplicitPackageVersion and we don't expect it to change anymore. Hence, we don't encode it here. --> |
40 |
| - </PropertyGroup> |
41 |
| - |
42 | 51 | <!-- Keep in sync with available targeting packs under src/targetPacks/ILsrc. -->
|
43 | 52 | <ItemGroup>
|
44 | 53 | <KnownFrameworkReference Update="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App'))">
|
|
98 | 107 | '$(TargetFileName)'))" />
|
99 | 108 | </Target>
|
100 | 109 |
|
| 110 | + <!-- Use local targeting packs --> |
| 111 | + <Target Name="UseLocalTargetingPack" AfterTargets="ResolveFrameworkReferences"> |
| 112 | + <ItemGroup> |
| 113 | + <ResolvedTargetingPack Path="$(ArtifactsBinDir)%(ResolvedTargetingPack.NuGetPackageId).%(ResolvedTargetingPack.NuGetPackageVersion)\pack" |
| 114 | + PackageDirectory="$(ArtifactsBinDir)%(ResolvedTargetingPack.NuGetPackageId).%(ResolvedTargetingPack.NuGetPackageVersion)\pack" /> |
| 115 | + <ResolvedFrameworkReference TargetingPackPath="$(ArtifactsBinDir)%(ResolvedFrameworkReference.TargetingPackName).%(ResolvedFrameworkReference.TargetingPackVersion)\pack" /> |
| 116 | + </ItemGroup> |
| 117 | + </Target> |
| 118 | + |
101 | 119 | </Project>
|
0 commit comments