public async Task <bool> BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor) { IProject p = wrapped as IProject; if (p == null) { return(await wrapped.BuildAsync(options, feedbackSink, progressMonitor)); } else { lock (service.unmodifiedProjects) { if (!service.unmodifiedProjects.TryGetValue(p, out lastCompilationPass)) { lastCompilationPass = null; } } if (lastCompilationPass != null && factory.Setting == BuildDetection.BuildModifiedAndDependent) { lock (cachedBuildDependencies) { var dependencies = options != null ? cachedBuildDependencies[options] : cachedBuildDependenciesForNullOptions; if (dependencies.OfType <Wrapper>().Any(w => w.WasRecompiledAfter(lastCompilationPass))) { lastCompilationPass = null; } } } if (lastCompilationPass != null) { feedbackSink.ReportMessage( StringParser.Parse("${res:MainWindow.CompilerMessages.SkipProjectNoChanges}", new StringTagPair("Name", p.Name)) ); return(true); } else { lastCompilationPass = factory.CurrentPass; var success = await wrapped.BuildAsync(options, feedbackSink, progressMonitor); if (success) { lock (service.unmodifiedProjects) { service.unmodifiedProjects[p] = factory.CurrentPass; } } return(success); } } }
public async void DoStartBuild(object state) { string name = string.Empty; try { name = project.Name; bool success = await project.BuildAsync(options, this, perNodeProgressMonitor).ConfigureAwait(false); Done(success); } catch (ObjectDisposedException) { // Handle ObjectDisposedException that occurs when trying to build a project that was unloaded. ReportError(new BuildError(null, "The project '" + name + "' was unloaded.")); Done(false); } }