Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 8afe4d2

Browse files
committed
[MSBuild] Allow msbuild process start to be intercepted
Support advanced scenarios where the running of MSBuild directly can be intercepted and monitored. This is done by adding a handler to the MSBuildProcessService which by default will call the Runtime.ProcessService's StartProcess.
1 parent 94b4f95 commit 8afe4d2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProcessService.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ namespace MonoDevelop.Projects.MSBuild
3434
{
3535
public static class MSBuildProcessService
3636
{
37+
/// <summary>
38+
/// Allows the MSBuild process start to be intercepted and monitored.
39+
/// </summary>
40+
public static Func<string, string, string, TextWriter, TextWriter, EventHandler, ProcessWrapper>
41+
StartProcessHandler { get; set; } = Runtime.ProcessService.StartProcess;
42+
3743
public static ProcessWrapper StartMSBuild (string arguments, string workingDirectory, TextWriter outWriter, TextWriter errorWriter, EventHandler exited)
3844
{
3945
FilePath msbuildBinPath = GetMSBuildBinPath ();
@@ -49,7 +55,7 @@ public static ProcessWrapper StartMSBuild (string arguments, string workingDirec
4955
arguments = argumentsBuilder.ToString ();
5056
}
5157

52-
return Runtime.ProcessService.StartProcess (
58+
return StartProcessHandler (
5359
command,
5460
arguments,
5561
workingDirectory,

0 commit comments

Comments
 (0)