Exemplo n.º 1
0
        IUpdatePackageActions CreateUpdateAllPackagesInSolution()
        {
            IPackageManagementSolution solution   = ConsoleHost.Solution;
            IPackageRepository         repository = GetActivePackageRepository();

            return(updatePackageActionsFactory.CreateUpdateAllPackagesInSolution(solution, repository));
        }
Exemplo n.º 2
0
        void CreateCommandLineWithSolution(string fileName)
        {
            IPackageManagementSolution solution = MockRepository.GenerateStub <IPackageManagementSolution>();

            solution.Stub(s => s.FileName).Return(fileName);
            commandLine = new NuGetPackageRestoreCommandLine(solution);
        }
 public NuGetPackageRestoreCommandLine(IPackageManagementSolution solution)
     : this(
         solution,
         MonoRuntimeInfo.FromCurrentRuntime(),
         EnvironmentUtility.IsMonoRuntime)
 {
 }
Exemplo n.º 4
0
 void CreateSolution()
 {
     if (solution == null)
     {
         solution = PackageManagementServices.Solution;
     }
 }
        void GetTitle(IPackageManagementSolution solution)
        {
            var    selectedProjects = new PackageManagementSelectedProjects(solution);
            string selectionName    = selectedProjects.SelectionName;

            Title = String.Format("{0} - Manage Packages", selectionName);
        }
		void CreatePackageInstallerServices()
		{
			fakeSolution = MockRepository.GenerateStub<IPackageManagementSolution>();
			installedPackages = new List<IPackage>();
			fakeSolution.Stub(s => s.GetPackages()).Return(installedPackages.AsQueryable());
			installerServices = new VsPackageInstallerServices(fakeSolution);
		}
		public PackageCompatibilityChecker (
			IPackageManagementSolution solution,
			IRegisteredPackageRepositories registeredRepositories)
		{
			this.solution = solution;
			this.registeredRepositories = registeredRepositories;
		}
Exemplo n.º 8
0
 public PackageReinstaller(
     IPackageManagementSolution solution,
     IBackgroundPackageActionRunner runner)
 {
     this.solution = solution;
     this.runner   = runner;
 }
        public static IPackageManagementProject GetProject(this IPackageManagementSolution solution, DotNetProject project)
        {
            var projectProxy = new DotNetProjectProxy(project);
            var repository   = PackageManagementServices.PackageRepositoryCache.CreateAggregateWithPriorityMachineCacheRepository();

            return(solution.GetProject(repository, projectProxy));
        }
Exemplo n.º 10
0
 public RestorePackagesCommand(
     IPackageManagementOutputMessagesView outputMessagesView,
     IPackageManagementSolution solution)
 {
     this.outputMessagesView = outputMessagesView;
     this.solution           = solution;
 }
 public PackageCompatibilityChecker(
     IPackageManagementSolution solution,
     IRegisteredPackageRepositories registeredRepositories)
 {
     this.solution = solution;
     this.registeredRepositories = registeredRepositories;
 }
 public IUpdatePackageActions CreateUpdatePackageInAllProjects(
     PackageReference packageReference,
     IPackageManagementSolution solution,
     IPackageRepository sourceRepository)
 {
     return(new UpdatePackageInAllProjects(packageReference, solution, sourceRepository));
 }
 public UpdateAllPackagesInSolution(
     IPackageManagementSolution solution,
     IPackageRepository sourceRepository)
 {
     this.solution         = solution;
     this.sourceRepository = sourceRepository;
 }
		public NuGetPackageRestoreCommandLine (IPackageManagementSolution solution)
			: this (
				solution,
				MonoRuntimeInfo.FromCurrentRuntime (),
				EnvironmentUtility.IsMonoRuntime)
		{
		}
		public UpdateAllPackagesInSolution(
			IPackageManagementSolution solution,
			IPackageRepository sourceRepository)
		{
			this.solution = solution;
			this.sourceRepository = sourceRepository;
		}
        public RestorePackagesCommand(
			IPackageManagementOutputMessagesView outputMessagesView,
			IPackageManagementSolution solution)
        {
            this.outputMessagesView = outputMessagesView;
            this.solution = solution;
        }
        public IUpdatePackageActions CreateUpdatePackageInAllProjects(
			PackageReference packageReference,
			IPackageManagementSolution solution,
			IPackageRepository sourceRepository)
        {
            return new UpdatePackageInAllProjects(packageReference, solution, sourceRepository);
        }
Exemplo n.º 18
0
        void GetTitle(IPackageManagementSolution solution)
        {
            var    selectedProjects = new PackageManagementSelectedProjects(solution);
            string selectionName    = selectedProjects.SelectionName;

            Title = GettextCatalog.GetString("{0} - Manage Packages", selectionName);
        }
 void CreatePackageInstallerServices()
 {
     fakeSolution      = MockRepository.GenerateStub <IPackageManagementSolution>();
     installedPackages = new List <IPackage>();
     fakeSolution.Stub(s => s.GetPackages()).Return(installedPackages.AsQueryable());
     installerServices = new VsPackageInstallerServices(fakeSolution);
 }
		public PackageReinstaller (
			IPackageManagementSolution solution,
			IBackgroundPackageActionRunner runner)
		{
			this.solution = solution;
			this.runner = runner;
		}
Exemplo n.º 21
0
 internal PackageRestoreRunner(IPackageManagementSolution solution)
     : this(
         solution,
         PackageManagementServices.ProgressMonitorFactory,
         PackageManagementServices.PackageManagementEvents,
         PackageManagementServices.ProgressProvider)
 {
 }
		internal PackageRestoreRunner (IPackageManagementSolution solution)
			: this (
				solution,
				PackageManagementServices.ProgressMonitorFactory,
				PackageManagementServices.PackageManagementEvents,
				PackageManagementServices.ProgressProvider)
		{
		}
 public IUpdatePackageActions CreateUpdateAllPackagesInSolution(
     IPackageManagementSolution solution,
     IPackageRepository sourceRepository)
 {
     SolutionPassedToCreateUpdateAllPackagesInSolution         = solution;
     SourceRepositoryPassedToCreateUpdateAllPackagesInSolution = sourceRepository;
     return(FakeUpdateAllPackagesInSolution);
 }
Exemplo n.º 24
0
 public UpdateAllPackagesInSolution(
     IPackageManagementSolution solution,
     IPackageRepository sourceRepository)
 {
     this.solution         = solution;
     this.sourceRepository = sourceRepository;
     UpdateDependencies    = true;
 }
		public IUpdatePackageActions CreateUpdateAllPackagesInSolution(
			IPackageManagementSolution solution,
			IPackageRepository sourceRepository)
		{
			SolutionPassedToCreateUpdateAllPackagesInSolution = solution;
			SourceRepositoryPassedToCreateUpdateAllPackagesInSolution = sourceRepository;
			return FakeUpdateAllPackagesInSolution;
		}
		public UpdateAllPackagesInSolution(
			IPackageManagementSolution solution,
			IPackageRepository sourceRepository)
		{
			this.solution = solution;
			this.sourceRepository = sourceRepository;
			UpdateDependencies = true;
		}
		public void RestoreAllPackagesInSolution (
			IPackageManagementSolution solution,
			IEnumerable<DotNetProject> projects,
			Action afterRestore)
		{
			var restorer = new PackageRestorer (solution, projects);
			Restore (restorer, afterRestore);
		}
		public static void Restore (
			IPackageManagementSolution solution,
			IPackageManagementProject project,
			Action afterRestore)
		{
			var runner = new RestoreBeforeUpdateAction ();
			runner.RestoreProjectPackages (solution, project.DotNetProject, afterRestore);
		}
 public UpdateSolutionPackagesAction(
     IPackageManagementSolution solution,
     IPackageManagementEvents packageManagementEvents)
 {
     this.Solution                = solution;
     this.UpdateDependencies      = true;
     this.packageManagementEvents = packageManagementEvents;
 }
 void GenerateCommandLine(IPackageManagementSolution solution)
 {
     if (EnvironmentUtility.IsMonoRuntime) {
         GenerateMonoCommandLine(solution);
     } else {
         GenerateWindowsCommandLine(solution);
     }
 }
		public UpdateSolutionPackagesAction(
			IPackageManagementSolution solution,
			IPackageManagementEvents packageManagementEvents)
		{
			this.Solution = solution;
			this.UpdateDependencies = true;
			this.packageManagementEvents = packageManagementEvents;
		}
Exemplo n.º 32
0
        public void RestoreProjectPackages(
            IPackageManagementSolution solution,
            DotNetProject project,
            Action afterRestore)
        {
            var restorer = new PackageRestorer(solution, project);

            Restore(restorer, afterRestore);
        }
Exemplo n.º 33
0
        public void RestoreAllPackagesInSolution(
            IPackageManagementSolution solution,
            IEnumerable <DotNetProject> projects,
            Action afterRestore)
        {
            var restorer = new PackageRestorer(solution, projects);

            Restore(restorer, afterRestore);
        }
Exemplo n.º 34
0
        public static void Restore(
            IPackageManagementSolution solution,
            IPackageManagementProject project,
            Action afterRestore)
        {
            var runner = new RestoreBeforeUpdateAction();

            runner.RestoreProjectPackages(solution, project.DotNetProject, afterRestore);
        }
Exemplo n.º 35
0
 protected override PackageCompatibilityChecker CreatePackageCompatibilityChecker(
     IPackageManagementSolution solution,
     IRegisteredPackageRepositories registeredRepositories)
 {
     return(new TestablePackageCompatibilityChecker(solution, registeredRepositories)
     {
         PackageReferenceFile = PackageReferenceFile
     });
 }
		public PackageManagementConsoleHostProvider(
			IPackageManagementSolution solution,
			IRegisteredPackageRepositories registeredRepositories)
			: this(solution,
				registeredRepositories,
				new PowerShellDetection(),
				PackageManagementServices.PackageManagementEvents)
		{
		}
		public UpdatedPackageViewModel(
			IPackageFromRepository package,
			IPackageManagementSolution solution,
			IPackageManagementEvents packageManagementEvents,
			IPackageActionRunner actionRunner,
			ILogger logger)
			: base(package, solution, packageManagementEvents, actionRunner, logger)
		{
		}
Exemplo n.º 38
0
 public PackageRestoreRunner(
     IPackageManagementSolution solution,
     IPackageManagementProgressMonitorFactory progressMonitorFactory,
     IPackageManagementEvents packageManagementEvents)
 {
     this.solution = solution;
     this.progressMonitorFactory  = progressMonitorFactory;
     this.packageManagementEvents = packageManagementEvents;
 }
        public UpdatePackageInAllProjects(
			PackageReference packageReference,
			IPackageManagementSolution solution,
			IPackageRepository sourceRepository)
        {
            this.packageReference = packageReference;
            this.solution = solution;
            this.sourceRepository = sourceRepository;
        }
Exemplo n.º 40
0
		public PackageRestoreRunner(
			IPackageManagementSolution solution,
			IPackageManagementProgressMonitorFactory progressMonitorFactory,
			IPackageManagementEvents packageManagementEvents)
		{
			this.solution = solution;
			this.progressMonitorFactory = progressMonitorFactory;
			this.packageManagementEvents = packageManagementEvents;
		}
		public PackageManagementConsoleHostProvider(
			IPackageManagementSolution solution,
			IRegisteredPackageRepositories registeredRepositories,
			IPowerShellDetection powerShellDetection)
		{
			this.solution = solution;
			this.registeredRepositories = registeredRepositories;
			this.powerShellDetection = powerShellDetection;
		}
Exemplo n.º 42
0
 public ProjectTemplateNuGetPackageInstaller(
     IPackageManagementSolution solution,
     IPackageRepositoryCache packageRepositoryCache,
     IBackgroundPackageActionRunner backgroundPackageActionRunner)
 {
     this.packageManagementSolution     = solution;
     this.packageRepositoryCache        = packageRepositoryCache;
     this.backgroundPackageActionRunner = backgroundPackageActionRunner;
 }
 public UpdatePackageInAllProjects(
     PackageReference packageReference,
     IPackageManagementSolution solution,
     IPackageRepository sourceRepository)
 {
     this.packageReference = packageReference;
     this.solution         = solution;
     this.sourceRepository = sourceRepository;
 }
        void GenerateMonoCommandLine(IPackageManagementSolution solution)
        {
            Arguments = String.Format(
                "--runtime=v4.0 \"{0}\" restore \"{1}\"",
                NuGetExePath.GetPath(),
                solution.FileName);

            Command = Path.Combine(monoRuntime.Prefix, "bin", "mono");
        }
 public PackageManagementConsoleHostProvider(
     IPackageManagementSolution solution,
     IRegisteredPackageRepositories registeredRepositories)
     : this(solution,
            registeredRepositories,
            new PowerShellDetection(),
            PackageManagementServices.PackageManagementEvents)
 {
 }
		public ProjectTemplateNuGetPackageInstaller (
			IPackageManagementSolution solution,
			IPackageRepositoryCache packageRepositoryCache,
			IBackgroundPackageActionRunner backgroundPackageActionRunner)
		{
			this.packageManagementSolution = solution;
			this.packageRepositoryCache = packageRepositoryCache;
			this.backgroundPackageActionRunner = backgroundPackageActionRunner;
		}
		void GenerateMonoCommandLine(IPackageManagementSolution solution)
		{
			Arguments = String.Format(
				"--runtime=v4.0 \"{0}\" restore \"{1}\"",
				NuGetExePath.GetPath(),
				solution.FileName);

			Command = Path.Combine (monoRuntime.Prefix, "bin", "mono");
		}
 public PackageManagementConsoleHostProvider(
     IPackageManagementSolution solution,
     IRegisteredPackageRepositories registeredRepositories,
     IPowerShellDetection powerShellDetection)
 {
     this.solution = solution;
     this.registeredRepositories = registeredRepositories;
     this.powerShellDetection    = powerShellDetection;
 }
		void CreateSolution()
		{
			if (solution == null) {
				if (IsInDesignMode()) {
					solution = new FakePackageManagementSolution();
				} else {
					solution = PackageManagementServices.Solution;
				}
			}
		}
        void CreateSolution()
        {
            projects         = new List <IPackageManagementProject>();
            sourceRepository = MockRepository.GenerateStub <IPackageRepository>();

            solution = MockRepository.GenerateStub <IPackageManagementSolution>();
            solution
            .Stub(s => s.GetProjects(sourceRepository))
            .Return(projects);
        }
		public PackageManagementConsoleHost(
			IPackageManagementSolution solution,
			IRegisteredPackageRepositories registeredRepositories)
			: this(
				solution,
				registeredRepositories,
				new PowerShellHostFactory(),
				new PackageManagementAddInPath())
		{
		}
		 public IUpdatePackageActions CreateUpdatePackageInAllProjects(
			PackageReference packageReference,
			IPackageManagementSolution solution,
			IPackageRepository sourceRepository)
		{
			PackageReferencePassedToCreateUpdatePackageInAllProjects = packageReference;
			SolutionPassedToCreateUpdatePackageInAllProjects = solution;
			SourceRepositoryPassedToCreateUpdatePackageInAllProjects = sourceRepository;
			return FakeUpdatePackageInAllProjects;
		}
Exemplo n.º 53
0
        public void ProcessRecord_UpdateAllPackagesInSolution_CreatesUpdateAllPackagesSolution()
        {
            CreateCmdletWithActivePackageSourceAndProject();
            RunCmdlet();

            IPackageManagementSolution solution =
                fakeUpdateActionsFactory.SolutionPassedToCreateUpdateAllPackagesInSolution;

            Assert.AreEqual(fakeSolution, solution);
        }
		void CreateSolution()
		{
			projects = new List<IPackageManagementProject>();
			sourceRepository = MockRepository.GenerateStub<IPackageRepository>();
			
			solution = MockRepository.GenerateStub<IPackageManagementSolution>();
			solution
				.Stub(s => s.GetProjects(sourceRepository))
				.Return(projects);
		}
Exemplo n.º 55
0
        void UpdatePackageInAllProjects()
        {
            IPackageManagementSolution solution         = ConsoleHost.Solution;
            IPackageRepository         repository       = GetActivePackageRepository();
            PackageReference           packageReference = CreatePackageReference();
            IUpdatePackageActions      updateActions    =
                updatePackageActionsFactory.CreateUpdatePackageInAllProjects(packageReference, solution, repository);

            RunActions(updateActions);
        }
		public PackageViewModelFactory(
			IPackageManagementSolution solution,
			IPackageManagementEvents packageManagementEvents,
			IPackageActionRunner actionRunner)
		{
			this.Solution = solution;
			this.PackageManagementEvents = packageManagementEvents;
			this.PackageActionRunner = actionRunner;
			this.Logger = new PackageManagementLogger(packageManagementEvents);
		}
		public RestorePackagesAction (
			IPackageManagementSolution solution,
			IPackageManagementEvents packageManagementEvents)
			: this (
				solution,
				packageManagementEvents,
				PackageManagementServices.PackageRepositoryCache,
				new MonoDevelopPackageManagerFactory ())
		{
		}
		public PackageManagementConsoleHost(
			IPackageManagementSolution solution,
			IRegisteredPackageRepositories registeredRepositories,
			IPowerShellHostFactory powerShellHostFactory,
			IPackageManagementAddInPath addinPath)
		{
			this.Solution = solution;
			this.registeredRepositories = registeredRepositories;
			this.powerShellHostFactory = powerShellHostFactory;
			this.addinPath = addinPath;
		}
		public NuGetPackageRestoreCommandLine (
			IPackageManagementSolution solution,
			MonoRuntimeInfo monoRuntime,
			bool isMonoRuntime)
		{
			this.monoRuntime = monoRuntime;
			this.isMonoRuntime = isMonoRuntime;

			GenerateCommandLine(solution);
			GenerateWorkingDirectory(solution);
		}
		public static void Restore (
			IPackageManagementSolution solution,
			IEnumerable<IPackageManagementProject> projects,
			Action afterRestore)
		{
			var runner = new RestoreBeforeUpdateAction ();
			runner.RestoreAllPackagesInSolution (
				solution,
				projects.Select (project => project.DotNetProject),
				afterRestore);
		}