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); }
public override Task PostProcessAsync(INuGetProjectContext nuGetProjectContext, CancellationToken token) { if (restoreRequired) { return(RestorePackages(nuGetProjectContext, token)); } Runtime.RunInMainThread(() => { DotNetProject.DotNetCoreNotifyReferencesChanged(); }); return(base.PostProcessAsync(nuGetProjectContext, token)); }
public void NotifyProjectReferencesChanged(bool includeTransitiveProjectReferences) { Runtime.AssertMainThread(); DotNetProject.RefreshProjectBuilder(); if (includeTransitiveProjectReferences) { DotNetProject.DotNetCoreNotifyReferencesChanged(); } else { DotNetProject.NotifyModified("References"); } }
Task ReloadProject(DotNetProject projectToReload, string changedLock, bool refreshTransitiveReferences = false) { return(Runtime.RunInMainThread(async() => { if (changedLock != null) { LockFileChanged = true; } await projectToReload.ReevaluateProject(new ProgressMonitor()); if (refreshTransitiveReferences) { projectToReload.DotNetCoreNotifyReferencesChanged(transitiveOnly: true); } })); }
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); }