Exemplo n.º 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));
        }
Exemplo n.º 2
0
 public static PackageVersion HighestVersionAvailableOf(string packageId)
 {
     return(PackageVersion.HighestVersion(VersionsAvailableOf(packageId).ToArray()));
 }
Exemplo n.º 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()));
        }
Exemplo n.º 4
0
 public static PackageVersion HighestVersionAvailableOf(string packageId, List <LocalPackage> packages)
 {
     return(PackageVersion.HighestVersion(VersionsAvailableOf(packageId, packages).ToArray()));
 }
Exemplo n.º 5
0
 public static PackageVersion HighestVersionAvailableOf(this ISource source, string id)
 {
     return(PackageVersion.HighestVersion(source.VersionsAvailableOf(id).ToArray()));
 }