コード例 #1
0
        static PackageManagementServices()
        {
            options = new PackageManagementOptions();

            progressMonitorFactory        = new PackageManagementProgressMonitorFactory();
            backgroundPackageActionRunner = new BackgroundPackageActionRunner(progressMonitorFactory, packageManagementEvents);

            projectTargetFrameworkMonitor = new ProjectTargetFrameworkMonitor(projectService);
            packageCompatibilityHandler   = new PackageCompatibilityHandler();
            packageCompatibilityHandler.MonitorTargetFrameworkChanges(projectTargetFrameworkMonitor);

            updatedPackagesInWorkspace = new UpdatedNuGetPackagesInWorkspace(packageManagementEvents);

            projectOperations = new PackageManagementProjectOperations(backgroundPackageActionRunner, packageManagementEvents);

            workspace = new PackageManagementWorkspace();

            pluginManager = CreatePluginManager();

            credentialService = new PackageManagementCredentialService();
            credentialService.Initialize();

            PackageManagementBackgroundDispatcher.Initialize();

            nuGetConfigFileChangedMonitor.MonitorFileChanges();

            //analyzerPackageMonitor = new AnalyzerPackageMonitor ();
            MonoDevelop.Refactoring.PackageInstaller.PackageInstallerServiceFactory.PackageServices = new MonoDevelop.PackageManagement.Refactoring.NuGetPackageServicesProxy();
        }
		public TestableSolutionPackageRepository (
			ISolution solution,
			IMonoDevelopPackageRepositoryFactory repositoryFactory,
			PackageManagementOptions options)
			: base (solution, repositoryFactory, options)
		{
		}
コード例 #3
0
		public RegisteredPackageRepositories(
			IPackageRepositoryCache repositoryCache,
			PackageManagementOptions options)
		{
			this.repositoryCache = repositoryCache;
			this.options = options;
		}
コード例 #4
0
 public SolutionPackageRepositoryPath(
     ISolution solution,
     PackageManagementOptions options)
 {
     this.solution         = solution;
     PackageRepositoryPath = GetSolutionPackageRepositoryPath(options);
 }
コード例 #5
0
		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();
			PackageManagementBackgroundDispatcher.Initialize ();
		}
        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();
            PackageManagementBackgroundDispatcher.Initialize();
        }
コード例 #7
0
		void CreatePackageManager (IProject project, PackageReferenceRepositoryHelper packageRefRepositoryHelper)
		{
			options = new TestablePackageManagementOptions ();
			options.PackagesDirectory = "packages";

			repositoryPaths = new SolutionPackageRepositoryPath (project, options);
			var pathResolver = new DefaultPackagePathResolver (repositoryPaths.PackageRepositoryPath);

			fakeFileSystem = new FakeFileSystem ();

			fakeFeedSourceRepository = new FakePackageRepository ();
			fakeSolutionSharedRepository = packageRefRepositoryHelper.FakeSharedSourceRepository;

			fakePackageOperationResolverFactory = new FakePackageOperationResolverFactory ();
			fakePackageOperationResolver = fakePackageOperationResolverFactory.FakeInstallPackageOperationResolver;

			var fakeSolutionPackageRepository = new FakeSolutionPackageRepository ();
			fakeSolutionPackageRepository.FileSystem = fakeFileSystem;
			fakeSolutionPackageRepository.PackagePathResolver = pathResolver;
			fakeSolutionPackageRepository.FakeSharedRepository = fakeSolutionSharedRepository;

			packageManager = new MonoDevelopPackageManager (fakeFeedSourceRepository,
				packageRefRepositoryHelper.FakeProjectSystem,
				fakeSolutionPackageRepository,
				fakePackageOperationResolverFactory);
		}
コード例 #8
0
 public RegisteredPackageRepositories(
     IPackageRepositoryCache repositoryCache,
     PackageManagementOptions options)
 {
     this.repositoryCache = repositoryCache;
     this.options         = options;
 }
 public SolutionPackageRepositoryFactory(
     IMonoDevelopPackageRepositoryFactory repositoryFactory,
     PackageManagementOptions options)
 {
     this.repositoryFactory = repositoryFactory;
     this.options           = options;
 }
		void CreateFactory ()
		{
			options = new TestablePackageManagementOptions ();
			fakePackageRepositoryFactory = new FakePackageRepositoryFactory ();
			fakeProjectSystemFactory = new FakeProjectSystemFactory ();
			factory = new MonoDevelopPackageManagerFactory (fakePackageRepositoryFactory, fakeProjectSystemFactory, options);
		}
		public SolutionPackageRepositoryFactory(
			IMonoDevelopPackageRepositoryFactory repositoryFactory,
			PackageManagementOptions options)
		{
			this.repositoryFactory = repositoryFactory;
			this.options = options;
		}
コード例 #12
0
		public SolutionPackageRepositoryPath (
			ISolution solution,
			PackageManagementOptions options)
		{
			this.solution = solution;
			PackageRepositoryPath = GetSolutionPackageRepositoryPath (options);
		}
		void CreateOptions ()
		{
			var properties = new Properties ();
			var projectService = new FakePackageManagementProjectService ();
			fakeSettings = new FakeSettings ();
			SettingsProvider settingsProvider = TestablePackageManagementOptions.CreateSettingsProvider (fakeSettings, projectService);
			options = new PackageManagementOptions (properties, settingsProvider);
		}
コード例 #14
0
 public MonoDevelopPackageManagerFactory(
     IMonoDevelopPackageRepositoryFactory packageRepositoryFactory,
     IMonoDevelopProjectSystemFactory projectSystemFactory,
     PackageManagementOptions options)
 {
     this.packageRepositoryFactory = packageRepositoryFactory;
     this.projectSystemFactory     = projectSystemFactory;
     this.options = options;
 }
コード例 #15
0
 public PackageRepositoryCache(
     PackageManagementOptions options,
     IMonoDevelopPackageRepositoryFactory factory)
     : this(
         options,
         MachineCache.Default,
         factory)
 {
 }
		public MonoDevelopPackageManagerFactory(
			IMonoDevelopPackageRepositoryFactory packageRepositoryFactory,
		    IMonoDevelopProjectSystemFactory projectSystemFactory,
		    PackageManagementOptions options)
		{
			this.packageRepositoryFactory = packageRepositoryFactory;
			this.projectSystemFactory = projectSystemFactory;
			this.options = options;
		}
コード例 #17
0
		string GetSolutionPackageRepositoryPath (PackageManagementOptions options)
		{
			string customPath = options.GetCustomPackagesDirectory ();
			if (!String.IsNullOrEmpty (customPath)) {
				return Path.GetFullPath (customPath);
			}

			return Path.Combine (solution.BaseDirectory, options.PackagesDirectory);
		}
コード例 #18
0
		public PackageRepositoryCache (
			PackageManagementOptions options,
			IMonoDevelopPackageRepositoryFactory factory)
			: this (
				options,
				MachineCache.Default,
				factory)
		{
		}
コード例 #19
0
		public PackageRepositoryCache (
			PackageManagementOptions options,
			IPackageRepository machineCache,
			IMonoDevelopPackageRepositoryFactory factory)
		{
			this.options = options;
			this.machineCache = machineCache;
			this.factory = factory;
			this.recentPackages = options.RecentPackages;
		}
コード例 #20
0
 public PackageRepositoryCache(
     PackageManagementOptions options,
     IPackageRepository machineCache,
     IMonoDevelopPackageRepositoryFactory factory)
 {
     this.options        = options;
     this.machineCache   = machineCache;
     this.factory        = factory;
     this.recentPackages = options.RecentPackages;
 }
 public SolutionPackageRepository(
     ISolution solution,
     IMonoDevelopPackageRepositoryFactory repositoryFactory,
     PackageManagementOptions options)
 {
     this.repositoryFactory = repositoryFactory;
     repositoryPath         = new SolutionPackageRepositoryPath(solution, options);
     CreatePackagePathResolver();
     CreateFileSystem();
     CreateRepository(ConfigSettingsFileSystem.CreateConfigSettingsFileSystem(solution));
 }
コード例 #22
0
		public SolutionPackageRepository (
			ISolution solution,
			IMonoDevelopPackageRepositoryFactory repositoryFactory,
			PackageManagementOptions options)
		{
			this.repositoryFactory = repositoryFactory;
			repositoryPath = new SolutionPackageRepositoryPath(solution, options);
			CreatePackagePathResolver();
			CreateFileSystem();
			CreateRepository(ConfigSettingsFileSystem.CreateConfigSettingsFileSystem(solution));
		}
コード例 #23
0
        string GetSolutionPackageRepositoryPath(PackageManagementOptions options)
        {
            string customPath = options.GetCustomPackagesDirectory();

            if (!String.IsNullOrEmpty(customPath))
            {
                return(Path.GetFullPath(customPath));
            }

            return(Path.Combine(solution.BaseDirectory, options.PackagesDirectory));
        }
コード例 #24
0
        public PackageManagementOptionsViewModel(
            PackageManagementOptions options,
            IRecentPackageRepository recentPackageRepository,
            IMachinePackageCache machinePackageCache,
            IProcess process)
        {
            this.options = options;
            this.recentPackageRepository = recentPackageRepository;
            this.machinePackageCache     = machinePackageCache;
            this.process = process;

            this.HasNoRecentPackages = !RecentPackageRepositoryHasPackages();
            this.HasNoCachedPackages = !MachinePackageCacheHasPackages();
            this.IsAutomaticPackageRestoreOnOpeningSolutionEnabled = options.IsAutomaticPackageRestoreOnOpeningSolutionEnabled;
            this.IsCheckForPackageUpdatesOnOpeningSolutionEnabled  = options.IsCheckForPackageUpdatesOnOpeningSolutionEnabled;

            CreateCommands();
        }
コード例 #25
0
		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);
		}
コード例 #26
0
		public SolutionPackageRepositoryPath (
			IProject project,
			PackageManagementOptions options)
			: this (project.ParentSolution, options)
		{
		}
		void CreateViewModel (PackageManagementOptions options)
		{
			viewModel = new PackageManagementOptionsViewModel (options, fakeRecentRepository, fakeMachineCache, fakeProcess);			
		}
コード例 #28
0
 public PackageRepositoryCache(PackageManagementOptions options)
     : this(
         options,
         new MonoDevelopPackageRepositoryFactory())
 {
 }
コード例 #29
0
		void CreateOptions (Properties properties, FakeSettings fakeSettings)
		{
			CreateSettingsProvider (fakeSettings);
			options = new PackageManagementOptions (properties, settingsProvider);
		}
コード例 #30
0
		public PackageRepositoryCache (PackageManagementOptions options)
			: this(
				options,
				new MonoDevelopPackageRepositoryFactory ())
		{
		}
コード例 #31
0
 public SolutionPackageRepositoryPath(
     IProject project,
     PackageManagementOptions options)
     : this(project.ParentSolution, options)
 {
 }