Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use live built targeting packs and remove SBRP self dependency #1192

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.607103">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>412f115947777b9babf97716a20b056d0d77b1b9</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="10.0.0-beta.25126.4">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>6d4b01bce3a29c172faff5abc0bfe2ae3d1fef3d</Sha>
Expand Down
30 changes: 24 additions & 6 deletions src/referencePackages/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@

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

<!-- netstandard2.0's targeting pack uses the old package reference model which doesn't support using a local layout.
Therefore disable the package reference download via DisableImplicitFrameworkReferences and manually import the
packages' targets file to receive the references. -->
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<NETStandardLibraryArtifactsDir>$(ArtifactsBinDir)NETStandard.Library.2.0.3\pack\</NETStandardLibraryArtifactsDir>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<Import Project="$(NETStandardLibraryArtifactsDir)build\netstandard2.0\NETStandard.Library.targets" Condition="'$(TargetFramework)' == 'netstandard2.0' and '$(ExcludeRestorePackageImports)' != 'true' and Exists('$(NETStandardLibraryArtifactsDir)')" />

<PropertyGroup>
<EnableTargetingPackDownload>false</EnableTargetingPackDownload>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>

<!-- Avoid transitive framework reference downloads to minimize the number of targeting packs and prebuilts. -->
<DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads>

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

<PropertyGroup>
<!-- Avoid transitive framework reference downloads to minimize the number of targeting packs and prebuilts. -->
<DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads>
<!-- The SDK already sets the NETStandardImplicitPackageVersion and we don't expect it to change anymore. Hence, we don't encode it here. -->
</PropertyGroup>

<!-- Keep in sync with available targeting packs under src/targetPacks/ILsrc. -->
<ItemGroup>
<KnownFrameworkReference Update="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App'))">
Expand Down Expand Up @@ -98,4 +107,13 @@
'$(TargetFileName)'))" />
</Target>

<!-- Use local targeting packs -->
<Target Name="UseLocalTargetingPack" AfterTargets="ResolveFrameworkReferences">
<ItemGroup>
<ResolvedTargetingPack Path="$(ArtifactsBinDir)%(ResolvedTargetingPack.NuGetPackageId).%(ResolvedTargetingPack.NuGetPackageVersion)\pack"
PackageDirectory="$(ArtifactsBinDir)%(ResolvedTargetingPack.NuGetPackageId).%(ResolvedTargetingPack.NuGetPackageVersion)\pack" />
<ResolvedFrameworkReference TargetingPackPath="$(ArtifactsBinDir)%(ResolvedFrameworkReference.TargetingPackName).%(ResolvedFrameworkReference.TargetingPackVersion)\pack" />
</ItemGroup>
</Target>

</Project>