internal static void RunManagedProgram(string exe, string args, string workingDirectory, CompilerOutputParserBase parser) { using (ManagedProgram managedProgram = new ManagedProgram(MonoInstallationFinder.GetMonoInstallation("MonoBleedingEdge"), "4.0", exe, args)) { managedProgram.GetProcessStartInfo().WorkingDirectory = workingDirectory; managedProgram.Start(); managedProgram.WaitForExit(); if (managedProgram.ExitCode != 0) { if (parser != null) { string[] errorOutput = managedProgram.GetErrorOutput(); string[] standardOutput = managedProgram.GetStandardOutput(); IEnumerable<CompilerMessage> enumerable = parser.Parse(errorOutput, standardOutput, true); foreach (CompilerMessage current in enumerable) { Debug.LogPlayerBuildError(current.message, current.file, current.line, current.column); } } Debug.LogError(string.Concat(new string[] { "Failed running ", exe, " ", args, "\n\n", managedProgram.GetAllOutput() })); throw new Exception(string.Format("{0} did not run properly!", exe)); } } }
internal static void RunManagedProgram(string exe, string args, string workingDirectory, CompilerOutputParserBase parser) { using (ManagedProgram program = new ManagedProgram(MonoInstallationFinder.GetMonoInstallation("MonoBleedingEdge"), "4.0", exe, args)) { program.GetProcessStartInfo().WorkingDirectory = workingDirectory; program.Start(); program.WaitForExit(); if (program.ExitCode != 0) { if (parser != null) { string[] errorOutput = program.GetErrorOutput(); string[] standardOutput = program.GetStandardOutput(); IEnumerator<CompilerMessage> enumerator = parser.Parse(errorOutput, standardOutput, true).GetEnumerator(); try { while (enumerator.MoveNext()) { CompilerMessage current = enumerator.Current; Debug.LogPlayerBuildError(current.message, current.file, current.line, current.column); } } finally { if (enumerator == null) { } enumerator.Dispose(); } } Debug.LogError("Failed running " + exe + " " + args + "\n\n" + program.GetAllOutput()); throw new Exception(string.Format("{0} did not run properly!", exe)); } } }