GetBaseUnityDeveloperFolder() private method

private GetBaseUnityDeveloperFolder ( ) : string
return string
Example #1
0
        private static ProcessStartInfo GetJamStartInfo(bool includeModules)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("jam.pl LiveReloadableEditorAssemblies");
            if (includeModules)
            {
                using (List <string> .Enumerator enumerator = ModuleManager.GetJamTargets().GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        string current = enumerator.Current;
                        stringBuilder.Append(" ").Append(current);
                    }
                }
            }
            return(new ProcessStartInfo()
            {
                WorkingDirectory = Unsupported.GetBaseUnityDeveloperFolder(),
                RedirectStandardOutput = true,
                RedirectStandardError = false,
                Arguments = stringBuilder.ToString(),
                FileName = "perl"
            });
        }
        private static CompilerMessage[] ParseResults(string text)
        {
            Console.Write(text);
            string[] errorOutput = text.Split(ManagedEditorCodeRebuilder.kNewlineChars, StringSplitOptions.RemoveEmptyEntries);
            string   baseUnityDeveloperFolder = Unsupported.GetBaseUnityDeveloperFolder();
            List <CompilerMessage> list       = new MonoCSharpCompilerOutputParser().Parse(errorOutput, false).ToList <CompilerMessage>();

            for (int i = 0; i < list.Count; i++)
            {
                CompilerMessage value = list[i];
                value.file = Path.Combine(baseUnityDeveloperFolder, value.file);
                list[i]    = value;
            }
            return(list.ToArray());
        }
        private static CompilerMessage[] ParseResults(string text)
        {
            Console.Write(text);
            var lines  = text.Split(kNewlineChars, StringSplitOptions.RemoveEmptyEntries);
            var prefix = Unsupported.GetBaseUnityDeveloperFolder();

            var msgs = new MonoCSharpCompilerOutputParser().Parse(lines, false, "n/a").ToList();

            for (var index = 0; index < msgs.Count; index++)
            {
                var msg = msgs[index];
                msg.file    = Path.Combine(prefix, msg.file);
                msgs[index] = msg;
            }
            return(msgs.ToArray());
        }
        private static ProcessStartInfo GetJamStartInfo(bool includeModules)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("jam.pl LiveReloadableEditorAssemblies");
            if (includeModules)
            {
                foreach (string str in ModuleManager.GetJamTargets())
                {
                    builder.Append(" ").Append(str);
                }
            }
            return(new ProcessStartInfo {
                WorkingDirectory = Unsupported.GetBaseUnityDeveloperFolder(), RedirectStandardOutput = true, RedirectStandardError = false, Arguments = builder.ToString(), FileName = "perl"
            });
        }
        private static ProcessStartInfo GetJamStartInfo(bool includeModules)
        {
            StringBuilder moduleArgs = new StringBuilder();

            moduleArgs.Append("jam.pl LiveReloadableEditorAssemblies");
            if (includeModules)
            {
                foreach (string target in ModuleManager.GetJamTargets())
                {
                    moduleArgs.Append(" ").Append(target);
                }
            }

            var psi = new ProcessStartInfo
            {
                WorkingDirectory       = Unsupported.GetBaseUnityDeveloperFolder(),
                RedirectStandardOutput = true,
                RedirectStandardError  = false,
                //The only reason jam.pl exists is that I cannot figure out how to call jam.bat, or jam.exe directly. magic.
                Arguments = moduleArgs.ToString(),
                FileName  = "perl",
            };

            var path = Environment.GetEnvironmentVariable("PATH") ?? "";

            // on macOS the typical mercurial path might not be in our environment variable, so add it for executing jam
            if (Application.platform == RuntimePlatform.OSXEditor)
            {
                var localBin = "/usr/local/bin";
                if (!path.Contains(localBin))
                {
                    path = $"{path}:{localBin}";
                }
            }
            psi.EnvironmentVariables["PATH"] = path;

            return(psi);
        }
        private static ProcessStartInfo GetJamStartInfo(bool includeModules)
        {
            StringBuilder moduleArgs = new StringBuilder();

            moduleArgs.Append("jam.pl LiveReloadableEditorAssemblies");
            if (includeModules)
            {
                foreach (string target in ModuleManager.GetJamTargets())
                {
                    moduleArgs.Append(" ").Append(target);
                }
            }

            return(new ProcessStartInfo
            {
                WorkingDirectory = Unsupported.GetBaseUnityDeveloperFolder(),
                RedirectStandardOutput = true,
                RedirectStandardError = false,
                //The only reason jam.pl exists is that I cannot figure out how to call jam.bat, or jam.exe directly. magic.
                Arguments = moduleArgs.ToString(),
                FileName = "perl",
            });
        }