in src/Tasks/Microsoft.NET.Build.Tasks/ProjectContext.cs [79:127]
public IEnumerable<LockFileTargetLibrary> GetRuntimeLibraries(IEnumerable<string> excludeFromPublishPackageIds)
{
IEnumerable<LockFileTargetLibrary> runtimeLibraries = _lockFileTarget.Libraries;
Dictionary<string, LockFileTargetLibrary> libraryLookup =
runtimeLibraries.ToDictionary(e => e.Name, StringComparer.OrdinalIgnoreCase);
HashSet<string> allExclusionList = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
if (IsFrameworkDependent)
{
if (PlatformLibrary != null)
{
allExclusionList.UnionWith(_lockFileTarget.GetPlatformExclusionList(PlatformLibrary, libraryLookup));
}
}
if (excludeFromPublishPackageIds?.Any() == true)
{
HashSet<string> excludeFromPublishList =
GetExcludeFromPublishList(
excludeFromPublishPackageIds,
libraryLookup);
allExclusionList.UnionWith(excludeFromPublishList);
}
if (PackagesToBeFiltered != null)
{
var filterLookup = new Dictionary<string, HashSet<PackageIdentity>>(StringComparer.OrdinalIgnoreCase);
foreach (var pkg in PackagesToBeFiltered)
{
HashSet<PackageIdentity> packageinfos;
if (filterLookup.TryGetValue(pkg.Id, out packageinfos))
{
packageinfos.Add(pkg);
}
else
{
packageinfos = new HashSet<PackageIdentity>();
packageinfos.Add(pkg);
filterLookup.Add(pkg.Id, packageinfos);
}
}
allExclusionList.UnionWith(GetPackagesToBeFiltered(filterLookup, libraryLookup));
}
return runtimeLibraries.Filter(allExclusionList).ToArray();
}