UnityEditor.MonoProcessUtility.RunMonoProcess C# (CSharp) Method

RunMonoProcess() public static method

public static RunMonoProcess ( Process process, string name, string resultingFile ) : void
process Process
name string
resultingFile string
return void
        public static void RunMonoProcess(Process process, string name, string resultingFile)
        {
            MonoProcessRunner runner = new MonoProcessRunner();
            bool flag = runner.Run(process);
            if ((process.ExitCode != 0) || !File.Exists(resultingFile))
            {
                string str2 = string.Concat(new object[] { "Failed ", name, ": ", ProcessToString(process), " result file exists: ", File.Exists(resultingFile), ". Timed out: ", !flag }) + "\n\n";
                object[] objArray2 = new object[] { str2, "stdout:\n", runner.Output, "\n" };
                str2 = string.Concat(objArray2);
                object[] objArray3 = new object[] { str2, "stderr:\n", runner.Error, "\n" };
                string str = string.Concat(objArray3);
                Console.WriteLine(str);
                throw new UnityException(str);
            }
        }
    }

Usage Example

コード例 #1
0
        public static void MonoCilStrip(BuildTarget buildTarget, string managedLibrariesDirectory, string[] fileNames)
        {
            string profileDirectory = MonoInstallationFinder.GetProfileDirectory(BuildPipeline.CompatibilityProfileToClassLibFolder(ApiCompatibilityLevel.NET_4_6), "MonoBleedingEdge");
            string str = Path.Combine(profileDirectory, "mono-cil-strip.exe");

            for (int i = 0; i < fileNames.Length; i++)
            {
                string  text    = fileNames[i];
                Process process = MonoProcessUtility.PrepareMonoProcessBleedingEdge(managedLibrariesDirectory);
                string  text2   = text + ".out";
                process.StartInfo.Arguments = "\"" + str + "\"";
                ProcessStartInfo expr_67   = process.StartInfo;
                string           arguments = expr_67.Arguments;
                expr_67.Arguments = string.Concat(new string[]
                {
                    arguments,
                    " \"",
                    text,
                    "\" \"",
                    text,
                    ".out\""
                });
                MonoProcessUtility.RunMonoProcess(process, "byte code stripper", Path.Combine(managedLibrariesDirectory, text2));
                MonoAssemblyStripping.ReplaceFile(managedLibrariesDirectory + "/" + text2, managedLibrariesDirectory + "/" + text);
                File.Delete(managedLibrariesDirectory + "/" + text2);
            }
        }
All Usage Examples Of UnityEditor.MonoProcessUtility::RunMonoProcess