@@ -31,7 +31,7 @@ public class LockFileBuilderCache
3131 private readonly ConcurrentDictionary < CriteriaKey , List < ( List < SelectionCriteria > , bool ) > > _criteriaSets =
3232 new ( ) ;
3333
34- private readonly ConcurrentDictionary < ( CriteriaKey , string path , string aliases , LibraryIncludeFlags , int dependencyCount ) , Lazy < ( LockFileTargetLibrary , bool , NuGetFramework , NuGetFramework ) > > _lockFileTargetLibraryCache =
34+ private readonly ConcurrentDictionary < ( CriteriaKey , string path , string aliases , LibraryIncludeFlags , int dependencyCount , bool restoreEnableAnalyzerAssets ) , Lazy < ( LockFileTargetLibrary , bool , NuGetFramework , NuGetFramework ) > > _lockFileTargetLibraryCache =
3535 new ( ) ;
3636
3737 /// <summary>
@@ -106,7 +106,7 @@ public ContentItemCollection GetContentItems(LockFileLibrary library, LocalPacka
106106 /// <summary>
107107 /// Try to get a LockFileTargetLibrary from the cache.
108108 /// </summary>
109- internal ( LockFileTargetLibrary , bool , NuGetFramework , NuGetFramework ) GetLockFileTargetLibrary ( RestoreTargetGraph graph , NuGetFramework framework , LocalPackageInfo localPackageInfo , string aliases , LibraryIncludeFlags libraryIncludeFlags , List < LibraryDependency > dependencies , Func < ( LockFileTargetLibrary , bool , NuGetFramework , NuGetFramework ) > valueFactory )
109+ internal ( LockFileTargetLibrary , bool , NuGetFramework , NuGetFramework ) GetLockFileTargetLibrary ( RestoreTargetGraph graph , NuGetFramework framework , LocalPackageInfo localPackageInfo , string aliases , LibraryIncludeFlags libraryIncludeFlags , List < LibraryDependency > dependencies , bool restoreEnableAnalyzerAssets , Func < ( LockFileTargetLibrary , bool , NuGetFramework , NuGetFramework ) > valueFactory )
110110 {
111111 // Comparing RuntimeGraph for equality is very expensive,
112112 // so in case of a request where the RuntimeGraph is not empty we avoid using the cache.
@@ -116,7 +116,7 @@ public ContentItemCollection GetContentItems(LockFileLibrary library, LocalPacka
116116 localPackageInfo = localPackageInfo ?? throw new ArgumentNullException ( nameof ( localPackageInfo ) ) ;
117117 var criteriaKey = new CriteriaKey ( graph . TargetGraphName , framework ) ;
118118 var packagePath = localPackageInfo . ExpandedPath ;
119- return _lockFileTargetLibraryCache . GetOrAdd ( ( criteriaKey , packagePath , aliases , libraryIncludeFlags , dependencies . Count ) ,
119+ return _lockFileTargetLibraryCache . GetOrAdd ( ( criteriaKey , packagePath , aliases , libraryIncludeFlags , dependencies . Count , restoreEnableAnalyzerAssets ) ,
120120 key => new Lazy < ( LockFileTargetLibrary , bool , NuGetFramework , NuGetFramework ) > ( valueFactory ) ) . Value ;
121121 }
122122
0 commit comments