Exemple #1
0
        public IPackage ResolveDependency(PackageDependency dependency, IPackageConstraintProvider constraintProvider, bool allowPrereleaseVersions, bool preferListedPackages, DependencyVersion dependencyVersion)
        {
            if (!this.ResolveDependenciesVertically)
            {
                return(DependencyResolveUtility.ResolveDependencyCore(this, dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion));
            }
            Func <IPackageRepository, IPackage> resolveDependency = this.Wrap <IPackage>(r => DependencyResolveUtility.ResolveDependency(r, dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion), null);

            return((from r in this.Repositories select Task.Factory.StartNew <IPackage>(() => resolveDependency(r))).ToArray <Task <IPackage> >().WhenAny <IPackage>(package => (package != null)));
        }
        public IPackage ResolveDependency(PackageDependency dependency, IPackageConstraintProvider constraintProvider, bool allowPrereleaseVersions, bool preferListedPackages, DependencyVersion dependencyVersion)
        {
            if (ResolveDependenciesVertically)
            {
                Func <IPackageRepository, IPackage> resolveDependency = Wrap(
                    r => DependencyResolveUtility.ResolveDependency(r, dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion));

                return(Repositories.Select(r => Task.Factory.StartNew(() => resolveDependency(r)))
                       .ToArray()
                       .WhenAny(package => package != null));
            }
            return(DependencyResolveUtility.ResolveDependencyCore(this, dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion));
        }
Exemple #3
0
        public IPackage ResolveDependency(PackageDependency dependency, IPackageConstraintProvider constraintProvider, bool allowPrereleaseVersions, bool preferListedPackages, DependencyVersion dependencyVersion)
        {
            IDependencyResolver dependencyResolver = _repo as IDependencyResolver;

            if (dependencyResolver != null)
            {
                return(dependencyResolver.ResolveDependency(dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion));
            }

            return(DependencyResolveUtility.ResolveDependencyCore(
                       _repo,
                       dependency,
                       constraintProvider,
                       allowPrereleaseVersions,
                       preferListedPackages,
                       dependencyVersion));
        }
Exemple #4
0
        public IPackage ResolveDependency(PackageDependency dependency, IPackageConstraintProvider constraintProvider, bool allowPrereleaseVersions, bool preferListedPackages, DependencyVersion dependencyVersion)
        {
            IDependencyResolver resolver = this._repo as IDependencyResolver;

            return((resolver == null) ? DependencyResolveUtility.ResolveDependencyCore(this._repo, dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion) : resolver.ResolveDependency(dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion));
        }