Added some redirection and exception handling

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40692
This commit is contained in:
David Anderson 2007-04-12 19:08:01 +00:00
parent ccdddc16fb
commit 9542cf5113
2 changed files with 11 additions and 1 deletions

View File

@ -33,7 +33,14 @@ namespace builder
bld = new Win32Builder(cfg); bld = new Win32Builder(cfg);
} }
bld.BuildPackage(new PkgCore()); try
{
bld.BuildPackage(new PkgCore());
}
catch (System.Exception e)
{
Console.WriteLine("Build failed: " + e.Message);
}
} }
} }
} }

View File

@ -76,6 +76,8 @@ namespace builder
info.WorkingDirectory = path; info.WorkingDirectory = path;
info.FileName = cfg.BuilderPath; info.FileName = cfg.BuilderPath;
info.UseShellExecute = false; info.UseShellExecute = false;
info.RedirectStandardOutput = true;
info.RedirectStandardError = true;
if (cfg.BuildOptions != null) if (cfg.BuildOptions != null)
{ {
@ -85,6 +87,7 @@ namespace builder
info.Arguments += "/rebuild " + lib.ReleaseBuild + " " + projectFile; info.Arguments += "/rebuild " + lib.ReleaseBuild + " " + projectFile;
Process p = Process.Start(info); Process p = Process.Start(info);
Console.WriteLine(p.StandardOutput.ReadToEnd());
p.WaitForExit(); p.WaitForExit();
p.Close(); p.Close();