コード例 #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)));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: IDependencyResolver.cs プロジェクト: Litee/NuGet
        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));
        }
コード例 #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));
        }