[Microsoft.Build] Fix expected output newline from ProcessWrapper.OutputStreamChanged...
authorLudovic Henry <ludovic@xamarin.com>
Fri, 19 Feb 2016 14:40:02 +0000 (14:40 +0000)
committerLudovic Henry <ludovic@xamarin.com>
Fri, 19 Feb 2016 14:45:52 +0000 (14:45 +0000)
commitfb85e55a98a7df8c59b987f6dbb62f01aa4ec7c4
treebfa615a5c853ad1e35478b17db21339860251c54
parent3dd741e9cbbfb430303905c6291069e5901805c4
[Microsoft.Build] Fix expected output newline from ProcessWrapper.OutputStreamChanged and ProcessWrapper.ErrorStreamChanged

The previous implementation of ProcessWrapper OutputStreamChanged and ErrorStreamChanged would manually launch a background thread to read on the process StandardOutput and StandardError, then simply passing the output to the OutputStreamChanged and ErrorStreamChanged events. This mean that even the newline characters would be passed to these events, leaving these events callbacks deal with splitting the output line by line.
On the other hand, Process.OutputDataReceived and Process.ErrorDataReceived already split the data line by line, and discard the newline character. That implies that, to keep the old ProcessWrapper behaviour, we need to add these newlines character before calling OutputStreamChanged and ErrorStreamChanged events callbacks.
mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ProcessWrapper.cs