Exemple #1
0
        async Task RestorePackages(INuGetProjectContext nuGetProjectContext, CancellationToken token)
        {
            var packageRestorer = await Runtime.RunInMainThread(() => {
                return(CreateBuildIntegratedRestorer(project.ParentSolution));
            });

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

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

            // Ensure MSBuild tasks are up to date when the next build is run.
            project.ShutdownProjectBuilder();

            if (!packageRestorer.LockFileChanged)
            {
                // Need to refresh the references since the restore did not.
                await Runtime.RunInMainThread(() => {
                    DotNetProject.DotNetCoreNotifyReferencesChanged();
                });
            }

            await base.PostProcessAsync(nuGetProjectContext, token);
        }
        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 void Execute (CancellationToken cancellationToken)
		{
			Task task = ExecuteAsync (cancellationToken);
			using (var restoreTask = new PackageRestoreTask (task)) {
				task.Wait ();
			}
		}
Exemple #4
0
        public void Execute(CancellationToken cancellationToken)
        {
            Task task = RestorePackagesAsync(cancellationToken);

            using (var restoreTask = new PackageRestoreTask(task)) {
                task.Wait(cancellationToken);
            }

            if (CheckForUpdatesAfterRestore && !cancellationToken.IsCancellationRequested)
            {
                CheckForUpdates();
            }
        }
Exemple #5
0
        async Task RestorePackages(INuGetProjectContext nuGetProjectContext, CancellationToken token)
        {
            var packageRestorer = await Runtime.RunInMainThread(() => {
                return(CreateBuildIntegratedRestorer(project.ParentSolution));
            });

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

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

            if (!packageRestorer.LockFileChanged)
            {
                // Need to refresh the references since the restore did not.
                await Runtime.RunInMainThread(() => {
                    DotNetProject.DotNetCoreNotifyReferencesChanged();
                    packageManagementEvents.OnFileChanged(project.GetNuGetAssetsFilePath());
                });
            }

            await base.PostProcessAsync(nuGetProjectContext, token);
        }
Exemple #6
0
        async Task RestorePackages(INuGetProjectContext nuGetProjectContext, CancellationToken token)
        {
            var packageRestorer = await Runtime.RunInMainThread(() => {
                var solutionManager = PackageManagementServices.Workspace.GetSolutionManager(project.ParentSolution);
                return(new MonoDevelopBuildIntegratedRestorer(solutionManager));
            });

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

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

            if (!packageRestorer.LockFileChanged)
            {
                // Need to refresh the references since the restore did not.
                await Runtime.RunInMainThread(() => {
                    DotNetProject.NotifyModified("References");
                    packageManagementEvents.OnFileChanged(project.GetNuGetAssetsFilePath());
                });
            }

            await base.PostProcessAsync(nuGetProjectContext, token);
        }