Skip to content

Commit

Permalink
Add reference metadata to indicate that RAR can skip dependency searc…
Browse files Browse the repository at this point in the history
…hing
  • Loading branch information
nguerrera committed Nov 11, 2017
1 parent aeb5065 commit 6de9e78
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Expand Up @@ -65,6 +65,14 @@ Copyright (c) .NET Foundation. All rights reserved.
<NETBuildExtensionsError Condition="'$(DependsOnNETStandard)' == 'true' AND '$(NETStandardInbox)' != 'true' AND '$(_UsingOldSDK)' == 'true'"
ResourceName="UnsupportedSDKVersionForNetStandard20"/>

<!--
Just like references from packages, RAR should not waste time finding dependencies and related files for libraries added by this
extension. See related FindPackageDependenciesInResolveAssemblyReferences. This is an equivalent compat opt-out.
-->
<PropertyGroup Condition="'$(FindNETFrameworkExtensionDependenciesInResolveAssemblyReferences)' == ''">
<FindNETFrameworkExtensionDependenciesInResolveAssemblyReferences>false</FindNETFrameworkExtensionDependenciesInResolveAssemblyReferences>
</PropertyGroup>

<!--
.NET 4.7.1 has support for .NET Standard 2.0 built-in, so most of the facades aren't necessary. However, the assembly versions of a few set of assemblies
do not yet match the ones shipped in the support package for .NET Standard 2.0 on .NET 4.7 and below. This means that .NET 4.7 or lower libraries might have
Expand Down Expand Up @@ -113,6 +121,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<Reference Include="%(_NETStandardLibraryNETFrameworkLib.FileName)">
<HintPath>%(_NETStandardLibraryNETFrameworkLib.Identity)</HintPath>
<Private>false</Private>
<FindDependencies>$(FindNETFrameworkExtensionDependenciesInResolveAssemblyReferences)</FindDependencies>
</Reference>

<ReferenceCopyLocalPaths Include="@(_NETStandardLibraryNETFrameworkLib)" Condition="'%(FileName)' != 'netfx.force.conflicts'">
Expand Down
Expand Up @@ -102,6 +102,29 @@ Copyright (c) .NET Foundation. All rights reserved.
<PreprocessorValue Include="@(NuGetPreprocessorValue)" Exclude="@(PreprocessorValue)" />
</ItemGroup>

<!--
This will prevent RAR from spending time locating dependencies and related files for assemblies
that came from packages. PackageReference should already be promoted to a closure of Reference
items and we are responsible for adding package relates files to CopyLocal items, not RAR. This
is only configurable as a compat opt-out in case skipping the slow RAR code breaks something.
-->
<PropertyGroup Condition="'$(FindPackageDependenciesInResolveAssemblyReferences)' == ''">

<FindPackageDependenciesInResolveAssemblyReferences>false</FindPackageDependenciesInResolveAssemblyReferences>
</PropertyGroup>

<!--
Update static Reference items with NuGetPackageId metadata to set FindDependencies appropriately.
NetStandard.Library adds its references this way instead of the normal ResolvePackageDependencies,
and the mechanism is intended to be useable by other packages that have special logic for choosing
assets
-->
<ItemGroup>
<Reference Update="@(Reference)">
<FindDependencies Condition="'%(NuGetPackageId)' != ''">$(FindPackageDependenciesInResolveAssemblyReferences)</FindDependencies>
</Reference>
</ItemGroup>

<!--
*************************************
3. BUILD TARGETS
Expand Down Expand Up @@ -430,6 +453,7 @@ Copyright (c) .NET Foundation. All rights reserved.

<ResolvedCompileFileDefinitions Update="@(ResolvedCompileFileDefinitions)">
<HintPath>%(FullPath)</HintPath>
<FindDependencies>$(FindPackageDependenciesInResolveAssemblyReferences)</FindDependencies>
</ResolvedCompileFileDefinitions>
</ItemGroup>

Expand Down

0 comments on commit 6de9e78

Please sign in to comment.