Exemple #1
0
        public RestoreAndCheckForUpdatesAction(Solution solution)
        {
            this.solution           = solution;
            packageManagementEvents = PackageManagementServices.PackageManagementEvents;

            solutionManager = PackageManagementServices.Workspace.GetSolutionManager(solution);
            nugetProjects   = solutionManager.GetNuGetProjects().ToList();

            if (AnyProjectsUsingPackagesConfig())
            {
                restoreManager = new PackageRestoreManager(
                    solutionManager.CreateSourceRepositoryProvider(),
                    solutionManager.Settings,
                    solutionManager
                    );
            }

            if (AnyProjectsUsingProjectJson())
            {
                buildIntegratedRestorer = new MonoDevelopBuildIntegratedRestorer(
                    solutionManager.CreateSourceRepositoryProvider(),
                    solutionManager.Settings,
                    solution.BaseDirectory);
            }
        }
		public RestoreAndCheckForUpdatesAction (Solution solution)
		{
			this.solution = solution;
			packageManagementEvents = PackageManagementServices.PackageManagementEvents;

			solutionManager = PackageManagementServices.Workspace.GetSolutionManager (solution);
			nugetProjects = solutionManager.GetNuGetProjects ().ToList ();

			if (AnyProjectsUsingPackagesConfig ()) {
				restoreManager = new PackageRestoreManager (
					solutionManager.CreateSourceRepositoryProvider (),
					solutionManager.Settings,
					solutionManager
				);
			}

			if (AnyProjectsUsingProjectJson ()) {
				buildIntegratedRestorer = new MonoDevelopBuildIntegratedRestorer (
					solutionManager.CreateSourceRepositoryProvider (),
					solutionManager.Settings);
			}

			if (AnyNuGetAwareProjects ()) {
				nugetAwareRestorer = new NuGetAwareProjectPackageRestoreManager (solutionManager);
			}
		}
        async Task RestorePackagesAsync(
            List <BuildIntegratedNuGetProject> projects,
            CancellationToken token)
        {
            var packageRestorer = new MonoDevelopBuildIntegratedRestorer(solutionManager);

            var restoreTask = packageRestorer.RestorePackages(projects, token);

            using (var task = new PackageRestoreTask(restoreTask)) {
                await restoreTask;
            }

            // Ensure MSBuild tasks are up to date when the next build is run.
            foreach (BuildIntegratedNuGetProject project in projects)
            {
                var dotNetProject = project.GetDotNetProject();
                dotNetProject.DotNetProject.ShutdownProjectBuilder();

                if (!packageRestorer.LockFileChanged)
                {
                    // Need to re-evaluate. When updating multiple projects the restore done at the end
                    // may be a no-op. This results in no re-evaluation being done so we re-evaluate here.
                    //
                    // Need to refresh the references since the restore did not.
                    await Runtime.RunInMainThread(async() => {
                        await dotNetProject.DotNetProject.ReevaluateProject(new ProgressMonitor());
                        dotNetProject.DotNetProject.DotNetCoreNotifyReferencesChanged();
                    });
                }
            }
        }
        public RestoreAndCheckForUpdatesAction(Solution solution)
        {
            this.solution           = solution;
            packageManagementEvents = PackageManagementServices.PackageManagementEvents;

            solutionManager = PackageManagementServices.Workspace.GetSolutionManager(solution);
            solutionManager.ClearProjectCache();
            nugetProjects = solutionManager.GetNuGetProjects().ToList();

            // Use the same source repository provider for all restores and updates to prevent
            // the credential dialog from being displayed for each restore and updates.
            sourceRepositoryProvider = solutionManager.CreateSourceRepositoryProvider();

            if (AnyProjectsUsingPackagesConfig())
            {
                restoreManager = new PackageRestoreManager(
                    sourceRepositoryProvider,
                    solutionManager.Settings,
                    solutionManager
                    );
            }

            if (AnyDotNetCoreProjectsOrProjectsUsingProjectJson())
            {
                buildIntegratedRestorer = new MonoDevelopBuildIntegratedRestorer(
                    solutionManager,
                    sourceRepositoryProvider,
                    solutionManager.Settings);
            }

            if (AnyNuGetAwareProjects())
            {
                nugetAwareRestorer = new NuGetAwareProjectPackageRestoreManager(solutionManager);
            }
        }
        async Task PrepareForExecute()
        {
            nugetProjects = (await solutionManager.GetNuGetProjectsAsync()).ToList();
            if (AnyProjectsUsingPackagesConfig())
            {
                restoreManager = new PackageRestoreManager(
                    sourceRepositoryProvider,
                    solutionManager.Settings,
                    solutionManager
                    );
            }

            if (AnyDotNetCoreProjectsOrProjectsUsingProjectJson())
            {
                buildIntegratedRestorer = new MonoDevelopBuildIntegratedRestorer(
                    solutionManager,
                    sourceRepositoryProvider,
                    solutionManager.Settings);
            }

            if (AnyNuGetAwareProjects())
            {
                nugetAwareRestorer = new NuGetAwareProjectPackageRestoreManager(solutionManager);
            }
        }
Exemple #6
0
        public RestoreNuGetPackagesAction(Solution solution)
        {
            this.solution                 = solution;
            packageManagementEvents       = PackageManagementServices.PackageManagementEvents;
            RestorePackagesConfigProjects = true;

            solutionManager = PackageManagementServices.Workspace.GetSolutionManager(solution);
            solutionManager.ClearProjectCache();

            nugetProjects = solutionManager.GetNuGetProjects().ToList();

            if (AnyProjectsUsingPackagesConfig())
            {
                restoreManager = new PackageRestoreManager(
                    solutionManager.CreateSourceRepositoryProvider(),
                    solutionManager.Settings,
                    solutionManager
                    );
            }

            if (AnyDotNetCoreProjectsOrProjectsUsingProjectJson())
            {
                buildIntegratedRestorer = new MonoDevelopBuildIntegratedRestorer(solutionManager);
            }

            if (AnyNuGetAwareProjects())
            {
                nugetAwareRestorer = new NuGetAwareProjectPackageRestoreManager(solutionManager);
            }
        }
        public RestoreNuGetPackagesInNuGetIntegratedProject(
            DotNetProject project,
            BuildIntegratedNuGetProject nugetProject,
            IMonoDevelopSolutionManager solutionManager)
        {
            this.project            = project;
            this.nugetProject       = nugetProject;
            packageManagementEvents = PackageManagementServices.PackageManagementEvents;

            packageRestorer = new MonoDevelopBuildIntegratedRestorer(solutionManager);
        }
Exemple #8
0
        public RestoreNuGetPackagesInDotNetCoreProject(DotNetProject project)
        {
            this.project            = project;
            packageManagementEvents = PackageManagementServices.PackageManagementEvents;

            var solutionManager = PackageManagementServices.Workspace.GetSolutionManager(project.ParentSolution);

            nugetProject = solutionManager.GetNuGetProject(new DotNetProjectProxy(project)) as BuildIntegratedNuGetProject;

            packageRestorer = new MonoDevelopBuildIntegratedRestorer(solutionManager);
        }
        public RestoreNuGetPackagesInNuGetIntegratedProject(
            DotNetProject project,
            BuildIntegratedNuGetProject nugetProject,
            IMonoDevelopSolutionManager solutionManager)
        {
            this.project            = project;
            this.nugetProject       = nugetProject;
            packageManagementEvents = PackageManagementServices.PackageManagementEvents;

            packageRestorer = new MonoDevelopBuildIntegratedRestorer(
                solutionManager.CreateSourceRepositoryProvider(),
                solutionManager.Settings);
        }
		public RestoreNuGetPackagesInNuGetIntegratedProject (
			DotNetProject project,
			BuildIntegratedNuGetProject nugetProject,
			IMonoDevelopSolutionManager solutionManager)
		{
			this.project = project;
			this.nugetProject = nugetProject;
			packageManagementEvents = PackageManagementServices.PackageManagementEvents;

			packageRestorer = new MonoDevelopBuildIntegratedRestorer (
				solutionManager.CreateSourceRepositoryProvider (),
				solutionManager.Settings);
		}