diff --git a/src/Utilities/ToolTask.cs b/src/Utilities/ToolTask.cs index 3a8ff43f237..a4be487c4ee 100644 --- a/src/Utilities/ToolTask.cs +++ b/src/Utilities/ToolTask.cs @@ -658,6 +658,19 @@ protected virtual ProcessStartInfo GetProcessStartInfo( return startInfo; } + /// + /// We expect tasks to override this method if they need information about the tool process or its process events during task execution. + /// Implementation should make sure that the task is started in this method. + /// Starts the process during task execution. + /// + /// Fully populated instance representing the tool process to be started. + /// A started process. This could be or another instance. + protected virtual Process StartToolProcess(Process proc) + { + proc.Start(); + return proc; + } + /// /// Writes out a temporary response file and shell-executes the tool requested. Enables concurrent /// logging of the output of the tool. @@ -714,7 +727,7 @@ protected virtual int ExecuteTool( ExitCode = -1; // Start the process - proc.Start(); + proc = StartToolProcess(proc); // Close the input stream. This is done to prevent commands from // blocking the build waiting for input from the user.