void CleanAsync (IBuildTarget entry, IProgressMonitor monitor, ITimeTracker tt, bool isRebuilding) { try { tt.Trace ("Cleaning item"); SolutionItem it = entry as SolutionItem; if (it != null) { it.Clean (monitor, IdeApp.Workspace.ActiveConfiguration); } else { entry.RunTarget (monitor, ProjectService.CleanTarget, IdeApp.Workspace.ActiveConfiguration); } } catch (Exception ex) { monitor.ReportError (GettextCatalog.GetString ("Clean failed."), ex); } finally { tt.Trace ("Done cleaning"); } if (isRebuilding) { if (EndClean != null) { DispatchService.GuiSyncDispatch (() => OnEndClean (monitor, tt)); } } else { DispatchService.GuiDispatch (() => CleanDone (monitor, entry, tt)); } }
void BuildSolutionItemAsync (IBuildTarget entry, IProgressMonitor monitor, ITimeTracker tt, bool skipPrebuildCheck = false, ProjectOperationContext context = null) { BuildResult result = null; try { if (!skipPrebuildCheck) { tt.Trace ("Pre-build operations"); result = DoBeforeCompileAction (); } //wait for any custom tools that were triggered by the save, since the build may depend on them MonoDevelop.Ide.CustomTools.CustomToolService.WaitForRunningTools (monitor); if (skipPrebuildCheck || result.ErrorCount == 0) { tt.Trace ("Building item"); SolutionItem it = entry as SolutionItem; if (it != null) result = it.Build (monitor, IdeApp.Workspace.ActiveConfiguration, true, context); else if (entry is WorkspaceItem) result = ((WorkspaceItem)entry).Build (monitor, IdeApp.Workspace.ActiveConfiguration, context); else result = entry.RunTarget (monitor, ProjectService.BuildTarget, IdeApp.Workspace.ActiveConfiguration); } } catch (Exception ex) { monitor.ReportError (GettextCatalog.GetString ("Build failed."), ex); if (result == null) result = new BuildResult (); result.AddError ("Build failed. See the build log for details."); if (result.SourceTarget == null) result.SourceTarget = entry; } finally { tt.Trace ("Done building"); } DispatchService.GuiDispatch ( delegate { BuildDone (monitor, result, entry, tt); // BuildDone disposes the monitor }); }
void BuildSolutionItemAsync (IBuildTarget entry, IProgressMonitor monitor, ITimeTracker tt) { BuildResult result = null; try { tt.Trace ("Pre-build operations"); result = DoBeforeCompileAction (); if (result.ErrorCount == 0) { tt.Trace ("Building item"); SolutionItem it = entry as SolutionItem; if (it != null) result = it.Build (monitor, IdeApp.Workspace.ActiveConfiguration, true); else result = entry.RunTarget (monitor, ProjectService.BuildTarget, IdeApp.Workspace.ActiveConfiguration); } } catch (Exception ex) { monitor.ReportError (GettextCatalog.GetString ("Build failed."), ex); } finally { tt.Trace ("Done building"); } DispatchService.GuiDispatch ( delegate { BuildDone (monitor, result, entry, tt); // BuildDone disposes the monitor }); }
public void Clean (IBuildTarget entry) { entry.RunTarget (new NullProgressMonitor (), ProjectService.CleanTarget, IdeApp.Workspace.ActiveConfiguration); }