private BuildResult DoCompilation(string arguments) { string l; ProcessStartInfo si = new ProcessStartInfo(ncc, arguments); si.RedirectStandardOutput = true; si.RedirectStandardError = true; si.UseShellExecute = false; VProcess p = new VProcess(); p.StartInfo = si; p.Start(); p.OutWatch(); while ((!p.HasExited) && p.HasNoOut()) // while ((!p.HasExited) && (p.StandardOutput.Peek() == -1)) // this could eliminate VProcess outgrowth { System.Threading.Thread.Sleep(100); } CompilerResultsParser cr = new CompilerResultsParser(); while ((l = p.StandardOutput.ReadLine()) != null) { cr.Parse(l); } if ((l = p.StandardError.ReadLine()) != null) { cr.Parse("error: " + ncc + " execution problem"); } return(cr.GetResult()); }
private BuildResult DoCompilation(string arguments) { string l; ProcessStartInfo si = new ProcessStartInfo(ncc, arguments); si.RedirectStandardOutput = true; si.RedirectStandardError = true; si.UseShellExecute = false; VProcess p = new VProcess(); p.StartInfo = si; p.Start(); p.OutWatch(); while ((!p.HasExited) && p.HasNoOut()) // while ((!p.HasExited) && (p.StandardOutput.Peek() == -1)) // this could eliminate VProcess outgrowth { System.Threading.Thread.Sleep (100); } CompilerResultsParser cr = new CompilerResultsParser(); while ((l = p.StandardOutput.ReadLine()) != null) { cr.Parse(l); } if ((l = p.StandardError.ReadLine()) != null) { cr.Parse("error: " + ncc + " execution problem"); } return cr.GetResult(); }