Example #1
0
		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));
				}
			}
		}
Example #2
0
 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 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);
        }
 protected ManagedProgram StartCompiler(BuildTarget target, string compiler, List<string> arguments, bool setMonoEnvironmentVariables)
 {
     base.AddCustomResponseFileIfPresent(arguments, Path.GetFileNameWithoutExtension(compiler) + ".rsp");
     string responseFile = CommandLineFormatter.GenerateResponseFile(arguments);
     if (this.runUpdater)
     {
         UnityEditor.Scripting.Compilers.APIUpdaterHelper.UpdateScripts(responseFile, this._island.GetExtensionOfSourceFiles());
     }
     ManagedProgram program = new ManagedProgram(MonoInstallationFinder.GetMonoInstallation(), this._island._classlib_profile, compiler, " @" + responseFile, setMonoEnvironmentVariables);
     program.Start();
     return program;
 }
Example #5
0
 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;
 }