Ejemplo n.º 1
0
 private static IEnumerable <IPackage> FindCompatiblePackages(IDependencyResolver2 dependencyResolver, IPackageConstraintProvider constraintProvider, IEnumerable <string> packageIds, IPackage package, FrameworkName targetFramework, bool allowPrereleaseVersions) =>
 (from p in dependencyResolver.FindPackages(packageIds)
      where allowPrereleaseVersions || p.IsReleaseVersion()
  let dependency = p.FindDependency(package.Id, targetFramework)
                   let otherConstaint = constraintProvider.GetConstraint(p.Id)
                                            where (dependency != null) && (dependency.VersionSpec.Satisfies(package.Version) && ((otherConstaint == null) || otherConstaint.Satisfies(package.Version)))
                                        select p);
Ejemplo n.º 2
0
        public InstallWalker(IPackageRepository localRepository,
                             IDependencyResolver2 dependencyResolver,
                             IPackageConstraintProvider constraintProvider,
                             FrameworkName targetFramework,
                             ILogger logger,
                             bool ignoreDependencies,
                             bool allowPrereleaseVersions,
                             DependencyVersion dependencyVersion)
            : base(targetFramework)
        {

            if (dependencyResolver == null)
            {
                throw new ArgumentNullException("dependencyResolver");
            }
            if (localRepository == null)
            {
                throw new ArgumentNullException("localRepository");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            Repository = localRepository;
            Logger = logger;
            DependencyResolver = dependencyResolver;
            _ignoreDependencies = ignoreDependencies;
            ConstraintProvider = constraintProvider;
            _operations = new OperationLookup();
            _allowPrereleaseVersions = allowPrereleaseVersions;
            DependencyVersion = dependencyVersion;
            CheckDowngrade = true;
        }
Ejemplo n.º 3
0
 public InstallWalker(IPackageRepository localRepository, IDependencyResolver2 dependencyResolver, IPackageConstraintProvider constraintProvider, FrameworkName targetFramework, ILogger logger, bool ignoreDependencies, bool allowPrereleaseVersions, DependencyVersion dependencyVersion) : base(targetFramework)
 {
     this._packagesToKeep = new HashSet <IPackage>((IEqualityComparer <IPackage>)PackageEqualityComparer.IdAndVersion);
     if (dependencyResolver == null)
     {
         throw new ArgumentNullException("dependencyResolver");
     }
     if (localRepository == null)
     {
         throw new ArgumentNullException("localRepository");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     this.Repository               = localRepository;
     this.Logger                   = logger;
     this.DependencyResolver       = dependencyResolver;
     this._ignoreDependencies      = ignoreDependencies;
     this.ConstraintProvider       = constraintProvider;
     this._operations              = new OperationLookup();
     this._allowPrereleaseVersions = allowPrereleaseVersions;
     base.DependencyVersion        = dependencyVersion;
     this.CheckDowngrade           = true;
 }
        public InstallWalker(IPackageRepository localRepository,
                             IDependencyResolver2 dependencyResolver,
                             IPackageConstraintProvider constraintProvider,
                             FrameworkName targetFramework,
                             ILogger logger,
                             bool ignoreDependencies,
                             bool allowPrereleaseVersions,
                             DependencyVersion dependencyVersion)
            : base(targetFramework)
        {
            if (dependencyResolver == null)
            {
                throw new ArgumentNullException("dependencyResolver");
            }
            if (localRepository == null)
            {
                throw new ArgumentNullException("localRepository");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            Repository               = localRepository;
            Logger                   = logger;
            DependencyResolver       = dependencyResolver;
            _ignoreDependencies      = ignoreDependencies;
            ConstraintProvider       = constraintProvider;
            _operations              = new OperationLookup();
            _allowPrereleaseVersions = allowPrereleaseVersions;
            DependencyVersion        = dependencyVersion;
            CheckDowngrade           = true;
        }
 // this ctor is used for unit tests
 internal InstallWalker(IPackageRepository localRepository,
                        IDependencyResolver2 dependencyResolver,
                        ILogger logger,
                        bool ignoreDependencies,
                        bool allowPrereleaseVersions,
                        DependencyVersion dependencyVersion)
     : this(localRepository, dependencyResolver, null, logger, ignoreDependencies, allowPrereleaseVersions, dependencyVersion)
 {
 }
 public CoreInteropPackageManager(
     ISharedPackageRepository sharedRepo,
     IDependencyResolver2 dependencyResolver,
     CoreInteropSourceRepository sourceRepo)
 {
     _sharedRepo = sharedRepo;
     _sourceRepo = sourceRepo;
     DependencyResolver = dependencyResolver;
 }
Ejemplo n.º 7
0
 public ActionResolver(
     SourceRepository source,
     SourceRepository dependencyResolutionSource,
     ResolutionContext context)
 {
     _source = source;
     _dependencyResolver = new DependencyResolverFromSourceRepo(dependencyResolutionSource);
     _context = context;
 }
Ejemplo n.º 8
0
 public ActionResolver(
     SourceRepository source,
     SourceRepository dependencyResolutionSource,
     ResolutionContext context)
 {
     _source             = source;
     _dependencyResolver = new DependencyResolverFromSourceRepo(dependencyResolutionSource);
     _context            = context;
 }
Ejemplo n.º 9
0
 // this ctor is used for unit tests
 internal InstallWalker(IPackageRepository localRepository,
                        IDependencyResolver2 dependencyResolver,
                        ILogger logger,
                        bool ignoreDependencies,
                        bool allowPrereleaseVersions,
                        DependencyVersion dependencyVersion)
     : this(localRepository, dependencyResolver, null, logger, ignoreDependencies, allowPrereleaseVersions, dependencyVersion)
 {
 }
Ejemplo n.º 10
0
 public CoreInteropPackageManager(
     ISharedPackageRepository sharedRepo,
     IDependencyResolver2 dependencyResolver,
     CoreInteropSourceRepository sourceRepo)
 {
     _sharedRepo        = sharedRepo;
     _sourceRepo        = sourceRepo;
     DependencyResolver = dependencyResolver;
 }
 // this ctor is used for unit tests
 internal UpdateWalker(IPackageRepository localRepository,
                       IDependencyResolver2 sourceRepository,
                       IDependentsResolver dependentsResolver,
                       IPackageConstraintProvider constraintProvider,
                       ILogger logger,
                       bool updateDependencies,
                       bool allowPrereleaseVersions)
     : this(localRepository, sourceRepository, dependentsResolver, constraintProvider, null, logger, updateDependencies, allowPrereleaseVersions)
 {
 }
Ejemplo n.º 12
0
 // this ctor is used for unit tests
 internal UpdateWalker(IPackageRepository localRepository,
                     IDependencyResolver2 sourceRepository,
                     IDependentsResolver dependentsResolver,
                     IPackageConstraintProvider constraintProvider,
                     ILogger logger,
                     bool updateDependencies,
                     bool allowPrereleaseVersions)
     : this(localRepository, sourceRepository, dependentsResolver, constraintProvider, null, logger, updateDependencies, allowPrereleaseVersions)
 {
 }
 public UpdateWalker(IPackageRepository localRepository,
                     IDependencyResolver2 sourceRepository,
                     IDependentsResolver dependentsResolver,
                     IPackageConstraintProvider constraintProvider,
                     FrameworkName targetFramework,
                     ILogger logger,
                     bool updateDependencies,
                     bool allowPrereleaseVersions)
     : base(localRepository, sourceRepository, constraintProvider, targetFramework, logger, !updateDependencies, allowPrereleaseVersions, DependencyVersion.Lowest)
 {
     _dependentsResolver = dependentsResolver;
     AcceptedTargets     = PackageTargets.All;
 }
Ejemplo n.º 14
0
 public UpdateWalker(IPackageRepository localRepository,
                     IDependencyResolver2 sourceRepository,
                     IDependentsResolver dependentsResolver,
                     IPackageConstraintProvider constraintProvider,
                     FrameworkName targetFramework, 
                     ILogger logger,
                     bool updateDependencies,
                     bool allowPrereleaseVersions)
     : base(localRepository, sourceRepository, constraintProvider, targetFramework, logger, !updateDependencies, allowPrereleaseVersions, DependencyVersion.Lowest)
 {
     _dependentsResolver = dependentsResolver;
     AcceptedTargets = PackageTargets.All;
 }
        public CoreInteropProjectManager(
            InstallationTarget target,
            SourceRepository activeSource,
            IDependencyResolver2 dependencyResolver)
        {
            // Get the required features from the target
            _sharedRepo    = target.GetRequiredFeature <ISharedPackageRepository>();
            _refRepo       = target.GetRequiredFeature <IProjectManager>().LocalRepository;
            _projectSystem = target.TryGetFeature <IProjectSystem>();
            _target        = target;

            _sourceRepo = new CoreInteropSourceRepository(activeSource);
            _pacman     = new CoreInteropPackageManager(
                _sharedRepo,
                dependencyResolver,
                _sourceRepo);
        }
 public InstallWalker(IPackageRepository localRepository,
                      IDependencyResolver2 dependencyResolver,
                      FrameworkName targetFramework,
                      ILogger logger,
                      bool ignoreDependencies,
                      bool allowPrereleaseVersions,
                      DependencyVersion dependencyVersion) :
     this(localRepository,
          dependencyResolver,
          constraintProvider : NullConstraintProvider.Instance,
          targetFramework : targetFramework,
          logger : logger,
          ignoreDependencies : ignoreDependencies,
          allowPrereleaseVersions : allowPrereleaseVersions,
          dependencyVersion : dependencyVersion)
 {
 }
Ejemplo n.º 17
0
 public InstallWalker(IPackageRepository localRepository,
                      IDependencyResolver2 dependencyResolver,
                      FrameworkName targetFramework,
                      ILogger logger,
                      bool ignoreDependencies,
                      bool allowPrereleaseVersions,
                      DependencyVersion dependencyVersion) :
     this(localRepository,
          dependencyResolver,
          constraintProvider: NullConstraintProvider.Instance,
          targetFramework: targetFramework,
          logger: logger,
          ignoreDependencies: ignoreDependencies,
          allowPrereleaseVersions: allowPrereleaseVersions,
          dependencyVersion: dependencyVersion)
 {
 }
Ejemplo n.º 18
0
        public CoreInteropProjectManager(
            InstallationTarget target, 
            SourceRepository activeSource,
            IDependencyResolver2 dependencyResolver)
        {
            // Get the required features from the target
            _sharedRepo = target.GetRequiredFeature<ISharedPackageRepository>();
            _refRepo = target.GetRequiredFeature<IProjectManager>().LocalRepository;
            _projectSystem = target.TryGetFeature<IProjectSystem>();
            _target = target;

            _sourceRepo = new CoreInteropSourceRepository(activeSource);
            _pacman = new CoreInteropPackageManager(
                _sharedRepo,
                dependencyResolver,
                _sourceRepo);
        }
Ejemplo n.º 19
0
 private static IEnumerable<IPackage> FindCompatiblePackages(
     IDependencyResolver2 dependencyResolver,
     IPackageConstraintProvider constraintProvider,
     IEnumerable<string> packageIds,
     IPackage package,
     FrameworkName targetFramework,
     bool allowPrereleaseVersions)
 {
     return (from p in dependencyResolver.FindPackages(packageIds)
             where allowPrereleaseVersions || p.IsReleaseVersion()
             let dependency = p.FindDependency(package.Id, targetFramework)
             let otherConstaint = constraintProvider.GetConstraint(p.Id)
             where dependency != null &&
                   dependency.VersionSpec.Satisfies(package.Version) &&
                   (otherConstaint == null || otherConstaint.Satisfies(package.Version))
             select p);
 }