Пример #1
0
        void GetPackageOperations()
        {
            IPackageManagementProject project = GetSingleProjectSelected();

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

            packageOperations = project.GetInstallPackageOperations(package, installAction);
        }
		InstallPackageAction CreateInstallPackageAction(
			IPackageManagementProject project,
			PackageReference packageReference)
		{
			InstallPackageAction action = project.CreateInstallPackageAction();
			action.PackageId = packageReference.Id;
			action.PackageVersion = packageReference.Version;
			return action;
		}
Пример #3
0
		InstallPackageAction CreateInstallPackageTask(IPackageManagementProject project)
		{
			InstallPackageAction action = project.CreateInstallPackageAction();
			action.PackageId = Id;
			action.PackageVersion = Version;
			action.IgnoreDependencies = IgnoreDependencies.IsPresent;
			action.PackageScriptRunner = this;
			return action;
		}
        void GetPackageOperations()
        {
            IPackageManagementProject project = GetSingleProjectSelected();

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

            installAction.AllowPrereleaseVersions = parent.IncludePrerelease;
            packageOperations = project.GetInstallPackageOperations(package, installAction);
        }
        InstallPackageAction CreateInstallPackageAction(
            IPackageManagementProject project,
            PackageReference packageReference)
        {
            InstallPackageAction action = project.CreateInstallPackageAction();

            action.PackageId      = packageReference.Id;
            action.PackageVersion = packageReference.Version;
            return(action);
        }
Пример #6
0
        InstallPackageAction CreateInstallPackageTask(IPackageManagementProject project)
        {
            InstallPackageAction action = project.CreateInstallPackageAction();

            action.PackageId               = Id;
            action.PackageVersion          = Version;
            action.IgnoreDependencies      = IgnoreDependencies.IsPresent;
            action.AllowPrereleaseVersions = IncludePrerelease.IsPresent;
            action.PackageScriptRunner     = this;
            return(action);
        }
        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));
        }
Пример #8
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);
            }
        }
Пример #9
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);
        }
Пример #10
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);
        }
 InstallPackageAction CreateInstallPackageTask(IPackageManagementProject project)
 {
     InstallPackageAction action = project.CreateInstallPackageAction();
     action.PackageId = Id;
     action.PackageVersion = Version;
     action.IgnoreDependencies = IgnoreDependencies.IsPresent;
     action.AllowPrereleaseVersions = IncludePrerelease.IsPresent;
     action.PackageScriptRunner = this;
     if (DependencyVersion.HasValue) {
         action.DependencyVersion = DependencyVersion.Value;
     }
     return action;
 }
 protected virtual ProcessPackageOperationsAction CreateInstallPackageAction(
     IPackageManagementProject project)
 {
     return(project.CreateInstallPackageAction());
 }
Пример #13
0
        IEnumerable <IPackage> GetPackagesRequiringLicenseAcceptance(IPackageManagementSelectedProject selectedProject)
        {
            IPackageManagementProject project = selectedProject.Project;

            project.Logger = logger;
            IEnumerable <PackageOperation> operations = project.GetInstallPackageOperations(package, project.CreateInstallPackageAction());

            return(GetPackagesRequiringLicenseAcceptance(operations));
        }