Exemplo n.º 1
0
        public static FrameworkSpecificGroup FindMostCompatibleReferenceGroup(PackageReaderBase package, NuGetFramework target)
        {
            var groups  = package.GetReferenceItems(); //中身は List<T> なので二度舐め OK
            var nearest = new FrameworkReducer().GetNearest(target, groups.Select(x => x.TargetFramework));

            return(nearest != null
                ? groups.Single(x => x.TargetFramework.Equals(nearest))
                : null);
        }
Exemplo n.º 2
0
        static IEnumerable <string> GetCompatibleAssemblyReferences(NuGetFramework projectFramework, PackageReaderBase package)
        {
            var nearestFramework = package.GetReferenceItems().GetNearest(projectFramework);

            if (nearestFramework == null)
            {
                return(Enumerable.Empty <string>());
            }
            return(nearestFramework.Items.Select(PathUtility.GetPathWithDirectorySeparator));
        }
Exemplo n.º 3
0
 public static IEnumerable <string> GetAssemblyReferences(this PackageReaderBase package, NuGetFramework targetFramework)
 {
     return(package.GetReferenceItems().Where(x => x.TargetFramework == targetFramework).SelectMany(x => x.Items));
 }
 IReadOnlyList <string> GetRelativePackageAssemblyReferences(PackageReaderBase packageReader)
 => Normalize(GetMostCompatibleGroup(TargetFramework, packageReader.GetReferenceItems()))
 ?.Items
 ?.ToList();