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)); } } }
private static void HandleUpdaterReturnValue(ManagedProgram program) { if (program.ExitCode == 0) { Console.WriteLine(string.Join(Environment.NewLine, program.GetErrorOutput())); UpdateFilesInVCIfNeeded(); } else { ScriptUpdatingManager.ReportExpectedUpdateFailure(); if (program.ExitCode > 0) { ReportAPIUpdaterFailure(program.GetErrorOutput()); } else { ReportAPIUpdaterCrash(program.GetErrorOutput()); } } }
private static int RunUpdatingProgram(string executable, string arguments, out string stdOut, out string stdErr) { ManagedProgram managedProgram = new ManagedProgram(MonoInstallationFinder.GetMonoInstallation("MonoBleedingEdge"), "4.0", EditorApplication.applicationContentsPath + "/Tools/ScriptUpdater/" + executable, arguments); managedProgram.LogProcessStartInfo(); managedProgram.Start(); managedProgram.WaitForExit(); stdOut = managedProgram.GetStandardOutputAsString(); stdErr = string.Join("\r\n", managedProgram.GetErrorOutput()); return(managedProgram.ExitCode); }
private static void RunUpdatingProgram(string executable, string arguments) { string str = EditorApplication.applicationContentsPath + "/Tools/ScriptUpdater/" + executable; ManagedProgram program = new ManagedProgram(MonoInstallationFinder.GetMonoInstallation("MonoBleedingEdge"), "4.5", str, arguments); program.LogProcessStartInfo(); program.Start(); program.WaitForExit(); Console.WriteLine(string.Join(Environment.NewLine, program.GetStandardOutput())); if (program.ExitCode == 0) { UpdateFilesInVCIfNeeded(); } else { ReportAPIUpdaterFailure(program.GetErrorOutput()); } }
private static int RunUpdatingProgram(string executable, string arguments, out string stdOut, out string stdErr) { ManagedProgram managedProgram = new ManagedProgram(MonoInstallationFinder.GetMonoInstallation("MonoBleedingEdge"), "4.0", EditorApplication.applicationContentsPath + "/Tools/ScriptUpdater/" + executable, arguments); managedProgram.LogProcessStartInfo(); managedProgram.Start(); managedProgram.WaitForExit(); stdOut = managedProgram.GetStandardOutputAsString(); stdErr = string.Join("\r\n", managedProgram.GetErrorOutput()); return managedProgram.ExitCode; }