示例#1
0
        public static IPackage GetLatest(this ISource[] sources, PackageDependency dependency)
        {
            var packages = new List <ISource>(sources).Select(source => source.GetLatest(dependency)).Where(package => package != null).ToList();

            if (packages.Count <= 1)
            {
                return(packages.FirstOrDefault());
            }
            var highest = PackageVersion.HighestVersion(packages.Select(pkg => pkg.Version).ToArray());

            return(packages.FirstOrDefault(pkg => pkg.Version == highest));
        }
示例#2
0
 public static PackageVersion HighestVersionAvailableOf(string packageId)
 {
     return(PackageVersion.HighestVersion(VersionsAvailableOf(packageId).ToArray()));
 }
示例#3
0
        public static PackageVersion HighestVersionMatching(this ISource source, PackageDependency dependency)
        {
            var packages = source.GetPackagesMatchingDependencies(dependency);

            return(PackageVersion.HighestVersion(packages.Select(pkg => pkg.Version).ToArray()));
        }
示例#4
0
 public static PackageVersion HighestVersionAvailableOf(string packageId, List <LocalPackage> packages)
 {
     return(PackageVersion.HighestVersion(VersionsAvailableOf(packageId, packages).ToArray()));
 }
示例#5
0
 public static PackageVersion HighestVersionAvailableOf(this ISource source, string id)
 {
     return(PackageVersion.HighestVersion(source.VersionsAvailableOf(id).ToArray()));
 }