public ProcessPackageAction2 (
			IPackageManagementProject2 project,
			IPackageManagementEvents packageManagementEvents)
		{
			this.Project = project;
			this.packageManagementEvents = packageManagementEvents;
		}
 public UninstallPackageAction2(
     IPackageManagementProject2 project,
     IPackageManagementEvents packageManagementEvents)
     : base(project, packageManagementEvents)
 {
     this.AllowPrereleaseVersions = true;
 }
        UpdatePackageAction2 CreateAction(IPackageManagementProject2 project, IPackage package)
        {
            UpdatePackageAction2 action = CreateDefaultUpdatePackageAction(project);

            action.PackageId = package.Id;
            return(action);
        }
 public InstallPackageAction2(
     IPackageManagementProject2 project,
     IPackageManagementEvents packageManagementEvents)
     : base(project, packageManagementEvents)
 {
     DependencyVersion = DependencyVersion.Lowest;
 }
		public InstallPackageAction2(
			IPackageManagementProject2 project,
			IPackageManagementEvents packageManagementEvents)
			: base(project, packageManagementEvents)
		{
			DependencyVersion = DependencyVersion.Lowest;
		}
 public ProcessPackageAction2(
     IPackageManagementProject2 project,
     IPackageManagementEvents packageManagementEvents)
 {
     this.Project = project;
     this.packageManagementEvents = packageManagementEvents;
 }
		public UninstallPackageAction2 (
			IPackageManagementProject2 project,
			IPackageManagementEvents packageManagementEvents)
			: base(project, packageManagementEvents)
		{
			this.AllowPrereleaseVersions = true;
		}
Exemple #8
0
        protected UpdatePackageAction2 CreateDefaultUpdatePackageAction(IPackageManagementProject2 project)
        {
            UpdatePackageAction2 action = project.CreateUpdatePackageAction();

            SetUpdatePackageActionProperties(action);
            return(action);
        }
Exemple #9
0
        void ReinstallPackageInSingleProject()
        {
            IPackageManagementProject2 project = GetProject();
            IPackage package = FindPackageOrThrow(project);

            ReinstallPackageInProject(project, package);
        }
		UpdatePackageAction2 CreateUpdatePackageAction (IPackageManagementProject2 project)
		{
			UpdatePackageAction2 action = CreateDefaultUpdatePackageAction (project);
			action.PackageId = packageReference.Id;
			action.PackageVersion = packageReference.Version;
			return action;
		}
		public UpdatePackagesAction2 (
			IPackageManagementProject2 project,
			IPackageManagementEvents packageManagementEvents)
		{
			Project = project;
			this.packageManagementEvents = packageManagementEvents;
			UpdateDependencies = true;
		}
 public UpdatedPackages2(
     IPackageManagementProject2 project,
     IPackageRepository aggregateRepository)
     : this(
         project.GetPackages(),
         aggregateRepository)
 {
 }
Exemple #13
0
 public UpdatePackageAction2(
     IPackageManagementProject2 project,
     IPackageManagementEvents packageManagementEvents)
     : base(project, packageManagementEvents)
 {
     UpdateDependencies = true;
     UpdateIfPackageDoesNotExistInProject = true;
 }
		public UpdatedPackages2 (
			IPackageManagementProject2 project,
			IPackageRepository aggregateRepository)
			: this (
				project.GetPackages (),
				aggregateRepository)
		{
		}
		public UpdatePackageAction2 (
			IPackageManagementProject2 project,
			IPackageManagementEvents packageManagementEvents)
			: base(project, packageManagementEvents)
		{
			UpdateDependencies = true;
			UpdateIfPackageDoesNotExistInProject = true;
		}
        UpdatePackageAction2 CreateUpdatePackageAction(IPackageManagementProject2 project)
        {
            UpdatePackageAction2 action = CreateDefaultUpdatePackageAction(project);

            action.PackageId      = packageReference.Id;
            action.PackageVersion = packageReference.Version;
            return(action);
        }
 public UpdatePackagesAction2(
     IPackageManagementProject2 project,
     IPackageManagementEvents packageManagementEvents)
 {
     Project = project;
     this.packageManagementEvents = packageManagementEvents;
     UpdateDependencies           = true;
 }
        IQueryable <IPackage> GetPackagesFromSelectedProjectOrSolution()
        {
            IPackageManagementProject2 project = GetSelectedProject();

            if (project != null)
            {
                return(project.GetPackages());
            }
            return(GetSolutionPackages());
        }
        UpdatedPackages2 CreateUpdatedPackages(IPackageRepository repository)
        {
            IPackageManagementProject2 project = GetSelectedProject(repository);

            if (project != null)
            {
                return(new UpdatedPackages2(project, repository));
            }
            return(new UpdatedPackages2(GetSolutionPackages(), repository));
        }
Exemple #20
0
        void ReinstallAllPackagesInProject(IPackageManagementProject2 project)
        {
            // No need to update dependencies since all packages will be reinstalled.
            IgnoreDependencies = true;

            foreach (IPackage package in project.GetPackages())
            {
                ReinstallPackageInProject(project, package);
            }
        }
Exemple #21
0
        void ReinstallPackageInProject(IPackageManagementProject2 project, IPackage package)
        {
            ReinstallPackageAction2 action = CreateReinstallPackageAction(project, package);

            using (IDisposable operation = StartReinstallOperation(action)) {
                ExecuteWithScriptRunner(project, () => {
                    action.Execute();
                });
            }
        }
Exemple #22
0
        void UpdatePackageInSingleProject()
        {
            IPackageManagementProject2 project = GetProject();
            UpdatePackageAction2       action  = CreateUpdatePackageAction(project);

            using (IDisposable operation = StartUpdateOperation(action)) {
                ExecuteWithScriptRunner(project, () => {
                    action.Execute();
                });
            }
        }
Exemple #23
0
        UpdatePackageAction2 CreateUpdatePackageAction(IPackageManagementProject2 project)
        {
            UpdatePackageAction2 action = project.CreateUpdatePackageAction();

            action.PackageId               = Id;
            action.PackageVersion          = Version;
            action.UpdateDependencies      = UpdateDependencies;
            action.AllowPrereleaseVersions = AllowPreleaseVersions;
//			action.PackageScriptRunner = this;
            return(action);
        }
        void InstallPackage()
        {
            IPackageManagementProject2 project = GetProject();

            using (project.SourceRepository.StartInstallOperation(Id)) {
                InstallPackageAction2 action = CreateInstallPackageTask(project);
                ExecuteWithScriptRunner(project, () => {
                    action.Execute();
                });
            }
        }
Exemple #25
0
        ReinstallPackageAction2 CreateReinstallPackageAction(IPackageManagementProject2 project, IPackage package)
        {
            ReinstallPackageAction2 action = project.CreateReinstallPackageAction();

            action.PackageId               = package.Id;
            action.PackageVersion          = package.Version;
            action.UpdateDependencies      = UpdateDependencies;
            action.AllowPrereleaseVersions = AllowPreleaseVersions || !package.IsReleaseVersion();

            return(action);
        }
Exemple #26
0
        IPackage FindPackageOrThrow(IPackageManagementProject2 project)
        {
            IPackage package = project.FindPackage(Id, null);

            if (package != null)
            {
                return(package);
            }

            throw CreatePackageNotFoundException(Id);
        }
        InstallPackageAction2 CreateInstallPackageTask(IPackageManagementProject2 project)
        {
            InstallPackageAction2 action = project.CreateInstallPackageAction();

            action.PackageId               = Id;
            action.PackageVersion          = Version;
            action.IgnoreDependencies      = IgnoreDependencies.IsPresent;
            action.AllowPrereleaseVersions = IncludePrerelease.IsPresent;
            if (DependencyVersion.HasValue)
            {
                action.DependencyVersion = DependencyVersion.Value;
            }
            return(action);
        }
        public RunPackageScriptsAction(
            IPackageManagementProject2 project,
            IPackageScriptRunner scriptRunner,
            IPackageScriptFactory scriptFactory,
            IGlobalMSBuildProjectCollection projectCollection)
        {
            this.project           = project;
            extendedProject        = project as ExtendedPackageManagementProject;
            this.scriptRunner      = scriptRunner;
            this.scriptFactory     = scriptFactory;
            this.projectCollection = projectCollection;

            projectCollection.AddProject(project);
            RegisterEvents();
        }
		public RunPackageScriptsAction (
			IPackageManagementProject2 project,
			IPackageScriptRunner scriptRunner,
			IPackageScriptFactory scriptFactory,
			IGlobalMSBuildProjectCollection projectCollection)
		{
			this.project = project;
			extendedProject = project as ExtendedPackageManagementProject;
			this.scriptRunner = scriptRunner;
			this.scriptFactory = scriptFactory;
			this.projectCollection = projectCollection;
			
			projectCollection.AddProject(project);
			RegisterEvents();
		}
		InstallPackageAction2 CreateInstallPackageTask (IPackageManagementProject2 project)
		{
			InstallPackageAction2 action = project.CreateInstallPackageAction ();
			action.PackageId = Id;
			action.PackageVersion = Version;
			action.IgnoreDependencies = IgnoreDependencies.IsPresent;
			action.AllowPrereleaseVersions = IncludePrerelease.IsPresent;
			if (DependencyVersion.HasValue) {
				action.DependencyVersion = DependencyVersion.Value;
			}
			return action;
		}
		public RunPackageScriptsAction(
			IPackageScriptRunner scriptRunner,
			IPackageManagementProject2 project)
			: this(project, scriptRunner, new PackageScriptFactory (), new GlobalMSBuildProjectCollection ())
		{
		}
		public IUpdatePackageActions2 CreateUpdateAllPackagesInProject (IPackageManagementProject2 project)
		{
			return new UpdateAllPackagesInProject2 (project);
		}
Exemple #33
0
 public ReinstallPackageAction2(
     IPackageManagementProject2 project,
     IPackageManagementEvents packageManagementEvents)
     : base(project, packageManagementEvents)
 {
 }
		UpdatePackageAction2 CreateAction (IPackageManagementProject2 project, IPackage package)
		{
			UpdatePackageAction2 action = CreateDefaultUpdatePackageAction (project);
			action.PackageId = package.Id;
			return action;
		}
		void ReinstallAllPackagesInProject (IPackageManagementProject2 project)
		{
			// No need to update dependencies since all packages will be reinstalled.
			IgnoreDependencies = true;

			foreach (IPackage package in project.GetPackages ()) {
				ReinstallPackageInProject (project, package);
			}
		}
		protected void ExecuteWithScriptRunner (IPackageManagementProject2 project, Action action)
		{
			using (RunPackageScriptsAction runScriptsAction = CreateRunPackageScriptsAction (project)) {
				action ();
			}
		}
		RunPackageScriptsAction CreateRunPackageScriptsAction (IPackageManagementProject2 project)
		{
			return new RunPackageScriptsAction (this, project);
		}
 public IUpdatePackageActions2 CreateUpdateAllPackagesInProject(IPackageManagementProject2 project)
 {
     return(new UpdateAllPackagesInProject2(project));
 }
		protected UpdatePackageAction2 CreateDefaultUpdatePackageAction(IPackageManagementProject2 project)
		{
			UpdatePackageAction2 action = project.CreateUpdatePackageAction();
			SetUpdatePackageActionProperties(action);
			return action;
		}
 public RunPackageScriptsAction(
     IPackageScriptRunner scriptRunner,
     IPackageManagementProject2 project)
     : this(project, scriptRunner, new PackageScriptFactory(), new GlobalMSBuildProjectCollection())
 {
 }
		public ReinstallPackageAction2 (
			IPackageManagementProject2 project,
			IPackageManagementEvents packageManagementEvents)
			: base (project, packageManagementEvents)
		{
		}
		IPackage FindPackageOrThrow (IPackageManagementProject2 project)
		{
			IPackage package = project.FindPackage (Id, null);
			if (package != null) {
				return package;
			}

			throw CreatePackageNotFoundException (Id);
		}
		ReinstallPackageAction2 CreateReinstallPackageAction (IPackageManagementProject2 project, IPackage package)
		{
			ReinstallPackageAction2 action = project.CreateReinstallPackageAction ();
			action.PackageId = package.Id;
			action.PackageVersion = package.Version;
			action.UpdateDependencies = UpdateDependencies;
			action.AllowPrereleaseVersions = AllowPreleaseVersions || !package.IsReleaseVersion ();

			return action;
		}
 public ProcessPackageOperationsAction2(
     IPackageManagementProject2 project,
     IPackageManagementEvents packageManagementEvents)
     : base(project, packageManagementEvents)
 {
 }
		void ReinstallPackageInProject (IPackageManagementProject2 project, IPackage package)
		{
			ReinstallPackageAction2 action = CreateReinstallPackageAction (project, package);
			using (IDisposable operation = StartReinstallOperation (action)) {
				ExecuteWithScriptRunner (project, () => {
					action.Execute ();
				});
			}
		}
		public UpdateAllPackagesInProject2 (IPackageManagementProject2 project)
		{
			this.project = project;
			this.UpdateDependencies = true;
		}
		public void AddProject (IPackageManagementProject2 packageManagementProject)
		{
			AddProject (packageManagementProject.DotNetProject);
		}
Exemple #48
0
        IUpdatePackageActions2 CreateUpdateAllPackagesInProject()
        {
            IPackageManagementProject2 project = GetProject();

            return(updatePackageActionsFactory.CreateUpdateAllPackagesInProject(project));
        }
Exemple #49
0
 public UpdateAllPackagesInProject2(IPackageManagementProject2 project)
 {
     this.project            = project;
     this.UpdateDependencies = true;
 }
		public ProcessPackageOperationsAction2(
			IPackageManagementProject2 project,
			IPackageManagementEvents packageManagementEvents)
			: base(project, packageManagementEvents)
		{
		}
Exemple #51
0
 RunPackageScriptsAction CreateRunPackageScriptsAction(IPackageManagementProject2 project)
 {
     return(new RunPackageScriptsAction(this, project));
 }
		UpdatePackageAction2 CreateUpdatePackageAction (IPackageManagementProject2 project)
		{
			UpdatePackageAction2 action = project.CreateUpdatePackageAction ();
			action.PackageId = Id;
			action.PackageVersion = Version;
			action.UpdateDependencies = UpdateDependencies;
			action.AllowPrereleaseVersions = AllowPreleaseVersions;
//			action.PackageScriptRunner = this;
			return action;
		}
 public void AddProject(IPackageManagementProject2 packageManagementProject)
 {
     AddProject(packageManagementProject.DotNetProject);
 }
Exemple #54
0
 protected void ExecuteWithScriptRunner(IPackageManagementProject2 project, Action action)
 {
     using (RunPackageScriptsAction runScriptsAction = CreateRunPackageScriptsAction(project)) {
         action();
     }
 }