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);
            }
        }
Пример #2
0
        public static void MonoCilStrip(BuildTarget buildTarget, string managedLibrariesDirectory, string[] fileNames)
        {
            string buildToolsDirectory = BuildPipeline.GetBuildToolsDirectory(buildTarget);
            string str = Path.Combine(buildToolsDirectory, "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_5D   = process.StartInfo;
                string           arguments = expr_5D.Arguments;
                expr_5D.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);
            }
        }
Пример #3
0
        static public void MonoCilStrip(BuildTarget buildTarget, string managedLibrariesDirectory, string[] fileNames)
        {
            string basePath    = MonoInstallationFinder.GetProfileDirectory(BuildPipeline.CompatibilityProfileToClassLibFolder(ApiCompatibilityLevel.NET_4_6), MonoInstallationFinder.MonoBleedingEdgeInstallation);
            string cilStripper = Path.Combine(basePath, "mono-cil-strip.exe");

            foreach (string fileName in fileNames)
            {
                Process process = MonoProcessUtility.PrepareMonoProcessBleedingEdge(managedLibrariesDirectory);
                string  outFile = fileName + ".out";

                process.StartInfo.Arguments  = "\"" + cilStripper + "\"";
                process.StartInfo.Arguments += " \"" + fileName + "\" \"" + fileName + ".out\"";

                MonoProcessUtility.RunMonoProcess(process, "byte code stripper", Path.Combine(managedLibrariesDirectory, outFile));

                ReplaceFile(managedLibrariesDirectory + "/" + outFile, managedLibrariesDirectory + "/" + fileName);
                File.Delete(managedLibrariesDirectory + "/" + outFile);
            }
        }
        static public void MonoCilStrip(BuildTarget buildTarget, string managedLibrariesDirectory, string[] fileNames)
        {
            // Previously requested the directory for the ApiCompatibilityLevel.NET_4_6 profile. That gets
            // translated to unityjit which does not contain mono-cil-strip.exe.
            // Per the scripting team, hardcoding to 4.5 is the correct course of action at this time.
            string basePath    = MonoInstallationFinder.GetProfileDirectory("4.5", MonoInstallationFinder.MonoBleedingEdgeInstallation);
            string cilStripper = Path.Combine(basePath, "mono-cil-strip.exe");

            foreach (string fileName in fileNames)
            {
                Process process = MonoProcessUtility.PrepareMonoProcessBleedingEdge(managedLibrariesDirectory);
                string  outFile = fileName + ".out";

                process.StartInfo.Arguments  = "\"" + cilStripper + "\"";
                process.StartInfo.Arguments += " \"" + fileName + "\" \"" + fileName + ".out\"";

                MonoProcessUtility.RunMonoProcess(process, "byte code stripper", Path.Combine(managedLibrariesDirectory, outFile));

                ReplaceFile(managedLibrariesDirectory + "/" + outFile, managedLibrariesDirectory + "/" + fileName);
                File.Delete(managedLibrariesDirectory + "/" + outFile);
            }
        }