This commit is contained in:
mterwoord_cp 2010-08-12 09:11:17 +00:00
parent 2e00f427cd
commit 00acbb06cc
2 changed files with 21 additions and 9 deletions

View file

@ -48,7 +48,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Users", "Users", "{A4478219
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Kudzu", "Kudzu", "{9D82B35C-7133-4ADE-AA5C-0FFB2BFA8BA6}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Kudzu", "Kudzu", "{9D82B35C-7133-4ADE-AA5C-0FFB2BFA8BA6}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
..\source2\Users\Kudzu\Notes.html = ..\source2\Users\Kudzu\Notes.html
..\source2\Users\Kudzu\Old-IDANotes.html = ..\source2\Users\Kudzu\Old-IDANotes.html ..\source2\Users\Kudzu\Old-IDANotes.html = ..\source2\Users\Kudzu\Old-IDANotes.html
EndProjectSection EndProjectSection
EndProject EndProject

View file

@ -19,9 +19,23 @@ namespace Cosmos.Build.MSBuild
xProcessStartInfo.RedirectStandardOutput = true; xProcessStartInfo.RedirectStandardOutput = true;
xProcessStartInfo.RedirectStandardError = true; xProcessStartInfo.RedirectStandardError = true;
xProcessStartInfo.CreateNoWindow = true; xProcessStartInfo.CreateNoWindow = true;
using (var xProcess = Process.Start(xProcessStartInfo)) using (var xProcess = new Process())
{ {
xProcess.WaitForExit(); xProcess.ErrorDataReceived += delegate(object sender, DataReceivedEventArgs e)
{
mErrors.Add(e.Data);
};
xProcess.OutputDataReceived += delegate(object sender, DataReceivedEventArgs e)
{
mOutput.Add(e.Data);
};
xProcess.StartInfo = xProcessStartInfo;
mErrors = new List<string>();
mOutput = new List<string>();
xProcess.Start();
xProcess.BeginErrorReadLine();
xProcess.BeginOutputReadLine();
xProcess.WaitForExit(15 * 60 * 1000); // wait 15 minutes
if (xProcess.ExitCode != 0) if (xProcess.ExitCode != 0)
{ {
if (!xProcess.HasExited) if (!xProcess.HasExited)
@ -33,18 +47,17 @@ namespace Cosmos.Build.MSBuild
{ {
Log.LogError("Error occurred while invoking {0}", name); Log.LogError("Error occurred while invoking {0}", name);
} }
while (!xProcess.StandardOutput.EndOfStream) foreach (var xError in mErrors)
{ {
Log.LogMessage("{0} output: {1}", name, xProcess.StandardOutput.ReadLine()); Log.LogError(xError);
}
while (!xProcess.StandardError.EndOfStream)
{
Log.LogMessage("{0} error: {1}", name, xProcess.StandardError.ReadLine());
} }
return false; return false;
} }
} }
return true; return true;
} }
private List<string> mErrors;
private List<string> mOutput;
} }
} }