static PackageManagementServices() { options = new PackageManagementOptions(); packageRepositoryCache = new PackageRepositoryCache (options); userAgentGenerator = new UserAgentGeneratorForRepositoryRequests (); userAgentGenerator.Register (packageRepositoryCache); progressProvider = new PackageManagementProgressProvider (packageRepositoryCache); registeredPackageRepositories = new RegisteredPackageRepositories(packageRepositoryCache, options); projectTemplatePackageSources = new RegisteredProjectTemplatePackageSources(); projectTemplatePackageRepositoryCache = new ProjectTemplatePackageRepositoryCache(projectTemplatePackageSources); outputMessagesView = new PackageManagementOutputMessagesView(packageManagementEvents); solution = new PackageManagementSolution (registeredPackageRepositories, projectService, packageManagementEvents); packageActionRunner = new PackageActionRunner(packageManagementEvents); progressMonitorFactory = new PackageManagementProgressMonitorFactory (); backgroundPackageActionRunner = new BackgroundPackageActionRunner (progressMonitorFactory, packageManagementEvents, progressProvider); projectTargetFrameworkMonitor = new ProjectTargetFrameworkMonitor (projectService); packageCompatibilityHandler = new PackageCompatibilityHandler (); packageCompatibilityHandler.MonitorTargetFrameworkChanges (projectTargetFrameworkMonitor); updatedPackagesInSolution = new UpdatedPackagesInSolution (solution, registeredPackageRepositories, packageManagementEvents); projectOperations = new PackageManagementProjectOperations (solution, registeredPackageRepositories, backgroundPackageActionRunner, packageManagementEvents); InitializeCredentialProvider(); }
void RestoreAndCheckForUpdates (Solution solution) { bool checkUpdatesAfterRestore = ShouldCheckForUpdates && AnyProjectHasPackages (solution); var packageManagementSolution = new PackageManagementSolution (new PackageManagementSolutionProjectService (solution)); var restorer = new PackageRestorer (packageManagementSolution); PackageManagementBackgroundDispatcher.Dispatch (() => { restorer.Restore (); if (checkUpdatesAfterRestore && !restorer.RestoreFailed) { CheckForUpdates (); } restorer = null; }); }
void RestoreAndCheckForUpdates(Solution solution) { bool checkUpdatesAfterRestore = ShouldCheckForUpdates && AnyProjectHasPackages(solution); var packageManagementSolution = new PackageManagementSolution(new PackageManagementSolutionProjectService(solution)); var restorer = new PackageRestorer(packageManagementSolution); PackageManagementBackgroundDispatcher.Dispatch(() => { restorer.Restore(); if (checkUpdatesAfterRestore && !restorer.RestoreFailed) { CheckForUpdates(); } restorer = null; }); }
static PackageManagementServices() { options = new PackageManagementOptions(); packageRepositoryCache = new PackageRepositoryCache(options.PackageSources, options.RecentPackages); userAgentGenerator = new UserAgentGeneratorForRepositoryRequests(packageRepositoryCache); progressProvider = new PackageManagementProgressProvider (packageRepositoryCache); registeredPackageRepositories = new RegisteredPackageRepositories(packageRepositoryCache, options); projectTemplatePackageSources = new RegisteredProjectTemplatePackageSources(); projectTemplatePackageRepositoryCache = new ProjectTemplatePackageRepositoryCache(projectTemplatePackageSources); outputMessagesView = new PackageManagementOutputMessagesView(packageManagementEvents); solution = new PackageManagementSolution(registeredPackageRepositories, packageManagementEvents); packageActionRunner = new PackageActionRunner(packageManagementEvents); progressMonitorFactory = new PackageManagementProgressMonitorFactory (); backgroundPackageActionRunner = new BackgroundPackageActionRunner (progressMonitorFactory, packageManagementEvents); InitializeCredentialProvider(); }
void CreateSolution(PackageManagementOptions options) { testProject = ProjectHelper.CreateTestProject(); fakeRegisteredPackageRepositories = new FakeRegisteredPackageRepositories(); fakeProjectFactory = new FakePackageManagementProjectFactory(); fakeProjectService = new FakePackageManagementProjectService(); fakeProjectService.CurrentProject = testProject; fakeProjectService.OpenSolution = testProject.ParentSolution; fakeSolutionPackageRepositoryFactory = new FakeSolutionPackageRepositoryFactory(); fakeSolutionPackageRepository = fakeSolutionPackageRepositoryFactory.FakeSolutionPackageRepository; solution = new PackageManagementSolution( fakeRegisteredPackageRepositories, fakeProjectService, fakeProjectFactory, fakeSolutionPackageRepositoryFactory); }