Skip to content

Commit ea76780

Browse files
Use live built targeting packs and remove SBRP self dependency (#1192)
- Use the live built targeting packs by using the same hook that we use in runtime and various others repos. For netstandard2.0, manually import the build targets file that brings the references in. - Remove the SBRP self dependency Co-authored-by: Michael Simons <[email protected]>
1 parent e052587 commit ea76780

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

eng/Version.Details.xml

-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
99
</Dependency>
1010
<!-- Intermediate is necessary for source build. -->
11-
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.607103">
12-
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
13-
<Sha>412f115947777b9babf97716a20b056d0d77b1b9</Sha>
14-
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
15-
</Dependency>
16-
<!-- Intermediate is necessary for source build. -->
1711
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="10.0.0-beta.25126.4">
1812
<Uri>https://github.com/dotnet/arcade</Uri>
1913
<Sha>6d4b01bce3a29c172faff5abc0bfe2ae3d1fef3d</Sha>

src/referencePackages/Directory.Build.targets

+24-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22

33
<Import Project="..\..\Directory.Build.targets" />
44

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+
514
<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+
621
<!-- Disable RAR from transitively discovering dependencies for references. This is required as we don't copy
722
dependencies over into the output directory which means RAR can't resolve them.
823
This is also necessary to make P2Ps with same package ids but different versions work. -->
@@ -33,12 +48,6 @@
3348
<!-- Customization extension point -->
3449
<Import Project="$(CustomizationsPropsPath)" Condition="Exists('$(CustomizationsPropsPath)')" />
3550

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-
4251
<!-- Keep in sync with available targeting packs under src/targetPacks/ILsrc. -->
4352
<ItemGroup>
4453
<KnownFrameworkReference Update="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App'))">
@@ -98,4 +107,13 @@
98107
'$(TargetFileName)'))" />
99108
</Target>
100109

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+
101119
</Project>

0 commit comments

Comments
 (0)