예제 #1
0
 IPackageOperationResolver CreateInstallPackageOperationResolver(InstallPackageAction installAction)
 {
     return(packageOperationResolverFactory.CreateInstallPackageOperationResolver(
                LocalRepository,
                SourceRepository,
                Logger,
                installAction));
 }
        void InstallPackage()
        {
            InstallPackageAction action = Project.CreateInstallPackageAction();

            action.Package        = Package;
            action.OpenReadMeText = false;
            action.PreserveLocalCopyReferences = false;
            action.Execute();
        }
        void GetPackageOperations()
        {
            IPackageManagementProject project = GetSingleProjectSelected();

            project.Logger = logger;
            InstallPackageAction installAction = project.CreateInstallPackageAction();

            installAction.AllowPrereleaseVersions = parent.IncludePrerelease;
            packageOperations = project.GetInstallPackageOperations(package, installAction);
        }
        IEnumerable <IPackage> GetPackagesRequiringLicenseAcceptance(IPackageManagementSelectedProject selectedProject)
        {
            IPackageManagementProject project = selectedProject.Project;

            project.Logger = logger;
            InstallPackageAction installAction = project.CreateInstallPackageAction();

            installAction.AllowPrereleaseVersions = parent.IncludePrerelease;
            IEnumerable <PackageOperation> operations = project.GetInstallPackageOperations(package, installAction);

            return(GetPackagesRequiringLicenseAcceptance(operations));
        }
 public void Run(InstallPackageCommand command)
 {
     try {
         IPackageManagementProject project = PackageManagementServices.Solution.GetActiveProject();
         var action = new InstallPackageAction(project, PackageManagementServices.PackageManagementEvents);
         action.PackageId      = command.PackageId;
         action.PackageVersion = command.GetVersion();
         ProgressMonitorStatusMessage progressMessage = CreateProgressMessage(action.PackageId);
         PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, action);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
예제 #6
0
        IEnumerable <InstallPackageAction> CreateInstallPackageActions(DotNetProject dotNetProject, PackageReferencesForCreatedProject projectPackageReferences)
        {
            IPackageManagementProject project = CreatePackageManagementProject(dotNetProject);

            foreach (ProjectTemplatePackageReference packageReference in projectPackageReferences.PackageReferences)
            {
                InstallPackageAction action = project.CreateInstallPackageAction();
                action.PackageId      = packageReference.Id;
                action.PackageVersion = GetPackageVersion(packageReference);

                yield return(action);
            }
        }
		public IPackageOperationResolver CreateInstallPackageOperationResolver (
			IPackageRepository localRepository,
			IPackageRepository sourceRepository,
			ILogger logger,
			InstallPackageAction installAction)
		{
			LocalRepositoryPassedToCreateInstallPackageOperationsResolver = localRepository;
			SourceRepositoryPassedToCreateInstallPackageOperationsResolver = sourceRepository;
			LoggerPassedToCreateInstallPackageOperationResolver = logger;
			IgnoreDependenciesPassedToCreateInstallPackageOperationResolver = installAction.IgnoreDependencies;
			AllowPrereleaseVersionsPassedToCreateInstallPackageOperationResolver = installAction.AllowPrereleaseVersions;

			return FakeInstallPackageOperationResolver;
		}
		public IPackageOperationResolver CreateInstallPackageOperationResolver(
			IPackageRepository localRepository,
			IPackageRepository sourceRepository,
			ILogger logger,
			InstallPackageAction installAction)
		{
			return new InstallWalker(
				localRepository,
				sourceRepository,
				installAction.ProjectTargetFramework,
				logger,
				installAction.IgnoreDependencies,
				installAction.AllowPrereleaseVersions,
				DependencyVersion.Lowest);
		}
 public IPackageOperationResolver CreateInstallPackageOperationResolver(
     IPackageRepository localRepository,
     IPackageRepository sourceRepository,
     ILogger logger,
     InstallPackageAction installAction)
 {
     return(new InstallWalker(
                localRepository,
                sourceRepository,
                installAction.ProjectTargetFramework,
                logger,
                installAction.IgnoreDependencies,
                installAction.AllowPrereleaseVersions,
                DependencyVersion.Lowest));
 }
예제 #10
0
        public void InstallPackages(
            string packageSourceUrl,
            Project project,
            IEnumerable <PackageManagementPackageReference> packages)
        {
            List <IPackageAction> actions = null;

            DispatchService.GuiSyncDispatch(() => {
                IPackageRepository repository = CreatePackageRepository(packageSourceUrl);
                IPackageManagementProject packageManagementProject = solution.GetProject(repository, new DotNetProjectProxy((DotNetProject)project));
                actions = packages.Select(packageReference => {
                    InstallPackageAction action = packageManagementProject.CreateInstallPackageAction();
                    action.PackageId            = packageReference.Id;
                    action.PackageVersion       = new SemanticVersion(packageReference.Version);
                    return((IPackageAction)action);
                }).ToList();
            });

            ProgressMonitorStatusMessage progressMessage = GetProgressMonitorStatusMessages(actions);

            backgroundActionRunner.RunAndWait(progressMessage, actions);
        }
예제 #11
0
        public void InstallPackages(
            string packageSourceUrl,
            Project project,
            IEnumerable <PackageManagementPackageReference> packages)
        {
            List <IPackageAction> actions = null;

            Runtime.RunInMainThread(() => {
                IPackageRepository repository = CreatePackageRepository(packageSourceUrl);
                IPackageManagementProject packageManagementProject = solution.GetProject(repository, new DotNetProjectProxy((DotNetProject)project));
                actions = packages.Select(packageReference => {
                    InstallPackageAction action   = packageManagementProject.CreateInstallPackageAction();
                    action.PackageId              = packageReference.Id;
                    action.PackageVersion         = new SemanticVersion(packageReference.Version);
                    action.LicensesMustBeAccepted = false;
                    return((IPackageAction)action);
                }).ToList();
            }).Wait();

            ProgressMonitorStatusMessage progressMessage = GetProgressMonitorStatusMessages(actions);

            backgroundActionRunner.Run(progressMessage, actions);
        }
		public void InstallPackage(IPackage package, InstallPackageAction installAction)
		{
			RunPackageOperations(installAction.Operations);
			AddPackageReference(package, installAction.IgnoreDependencies, installAction.AllowPrereleaseVersions);
		}
		void AddInstallActionWithMissingPackageId (string packageId = "Unknown")
		{
			var action = new InstallPackageAction (new FakePackageManagementProject (), packageManagementEvents);
			action.PackageId = packageId;
			actions.Add (action);
		}
		public IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction)
		{
			IPackageOperationResolver resolver = CreateInstallPackageOperationResolver(installAction);
			return resolver.ResolveOperations(package);
		}
		IPackageOperationResolver CreateInstallPackageOperationResolver(InstallPackageAction installAction)
		{
			return packageOperationResolverFactory.CreateInstallPackageOperationResolver(
				LocalRepository,
				SourceRepository,
				Logger,
				installAction);
		}
		public IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction)
		{
			return packageManager.GetInstallPackageOperations(package, installAction);
		}
예제 #17
0
 public void InstallPackage(IPackage package, InstallPackageAction installAction)
 {
     RunPackageOperations(installAction.Operations);
     AddPackageReference(package, installAction.IgnoreDependencies, installAction.AllowPrereleaseVersions);
 }
		PackageReferenceNode CreatePackageReferenceNode (InstallPackageAction installAction)
		{
			return new PackageReferenceNode (
				new PackageReference (installAction.GetPackageId (), installAction.GetPackageVersion (), null, null, false),
				false,
				true);
		}
예제 #19
0
        public IEnumerable <PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction)
        {
            IPackageOperationResolver resolver = CreateInstallPackageOperationResolver(installAction);

            return(resolver.ResolveOperations(package));
        }
		public void InstallPackage (IPackage package, InstallPackageAction installAction)
		{
			PackagePassedToInstallPackage = package;

			IgnoreDependenciesPassedToInstallPackage = installAction.IgnoreDependencies;
			PackageOperationsPassedToInstallPackage = installAction.Operations;
			AllowPrereleaseVersionsPassedToInstallPackage = installAction.AllowPrereleaseVersions;
		}
		PackageReferenceNode CreatePackageReferenceNode (ProjectPackagesFolderNode parentNode, InstallPackageAction installAction)
		{
			return new PackageReferenceNode (
				parentNode,
				new PackageReference (installAction.GetPackageId (), installAction.GetPackageVersion (), null, null, false),
				false,
				true);
		}
예제 #22
0
		void InstallPackage ()
		{
			InstallPackageAction action = Project.CreateInstallPackageAction ();
			action.Package = Package;
			action.Execute ();
		}
		public virtual IEnumerable<PackageOperation> GetInstallPackageOperations (IPackage package, InstallPackageAction installAction)
		{
			PackagePassedToGetInstallPackageOperations = package;
			IgnoreDependenciesPassedToGetInstallPackageOperations = installAction.IgnoreDependencies;
			AllowPrereleaseVersionsPassedToGetInstallPackageOperations = installAction.AllowPrereleaseVersions;

			return FakeInstallOperations;
		}
 public IEnumerable <PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction)
 {
     return(packageManager.GetInstallPackageOperations(package, installAction));
 }
		public void InstallPackage (IPackage package, InstallPackageAction installAction)
		{
			InstallPackageAction (package, installAction);
		}
		public InstallPackageHelper (InstallPackageAction action)
		{
			this.action = action;
		}
 public void InstallPackage(IPackage package, InstallPackageAction installAction)
 {
     packageManager.InstallPackage(package, installAction);
 }
		public void InstallPackage(IPackage package, InstallPackageAction installAction)
		{
			packageManager.InstallPackage(package, installAction);
		}