PrepareFileName() protected static method

protected static PrepareFileName ( string fileName ) : string
fileName string
return string
        private Program StartCompilerImpl(List <string> arguments, string argsPrefix, bool msBuildCompiler)
        {
            foreach (string reference in this._island._references)
            {
                arguments.Add("/reference:" + ScriptCompilerBase.PrepareFileName(reference));
            }
            foreach (string str in ((IEnumerable <string>) this._island._defines).Distinct <string>())
            {
                arguments.Add("/define:" + str);
            }
            foreach (string file in this._island._files)
            {
                arguments.Add(ScriptCompilerBase.PrepareFileName(file).Replace('/', '\\'));
            }
            string path = !msBuildCompiler?Path.Combine(MicrosoftCSharpCompiler.WindowsDirectory, "Microsoft.NET\\Framework\\v4.0.30319\\Csc.exe") : Path.Combine(MicrosoftCSharpCompiler.ProgramFilesDirectory, "MSBuild\\14.0\\Bin\\csc.exe");

            if (!File.Exists(path))
            {
                throw new Exception("'" + path + "' not found, either .NET 4.5 is not installed or your OS is not Windows 8/8.1.");
            }
            this.AddCustomResponseFileIfPresent(arguments, "csc.rsp");
            string  responseFile = CommandLineFormatter.GenerateResponseFile((IEnumerable <string>)arguments);
            Program program      = new Program(new ProcessStartInfo()
            {
                Arguments = argsPrefix + "@" + responseFile, FileName = path, CreateNoWindow = true
            });

            program.Start();
            return(program);
        }
Beispiel #2
0
        protected override Program StartCompiler()
        {
            List <string> list = new List <string>
            {
                "-debug",
                "-target:library",
                "-out:" + this._island._output,
                "-x-type-inference-rule-attribute:" + typeof(TypeInferenceRuleAttribute)
            };

            string[] references = this._island._references;
            for (int i = 0; i < references.Length; i++)
            {
                string fileName = references[i];
                list.Add("-r:" + ScriptCompilerBase.PrepareFileName(fileName));
            }
            foreach (string current in this._island._defines.Distinct <string>())
            {
                list.Add("-define:" + current);
            }
            string[] files = this._island._files;
            for (int j = 0; j < files.Length; j++)
            {
                string fileName2 = files[j];
                list.Add(ScriptCompilerBase.PrepareFileName(fileName2));
            }
            string compiler = Path.Combine(base.GetProfileDirectory(), "booc.exe");

            return(base.StartCompiler(this._island._target, compiler, list));
        }
        protected override Program StartCompiler()
        {
            List <string> arguments = new List <string>()
            {
                "-debug", "-target:library", "-nowarn:0169", "-out:" + ScriptCompilerBase.PrepareFileName(this._island._output)
            };

            foreach (string reference in this._island._references)
            {
                arguments.Add("-r:" + ScriptCompilerBase.PrepareFileName(reference));
            }
            foreach (string str in ((IEnumerable <string>) this._island._defines).Distinct <string>())
            {
                arguments.Add("-define:" + str);
            }
            foreach (string file in this._island._files)
            {
                arguments.Add(ScriptCompilerBase.PrepareFileName(file));
            }
            foreach (string additionalReference in this.GetAdditionalReferences())
            {
                string str = Path.Combine(this.GetProfileDirectory(), additionalReference);
                if (File.Exists(str))
                {
                    arguments.Add("-r:" + ScriptCompilerBase.PrepareFileName(str));
                }
            }
            return((Program)this.StartCompiler(this._island._target, this.GetCompilerPath(arguments), arguments));
        }
Beispiel #4
0
        protected override Program StartCompiler()
        {
            List <string> arguments = new List <string> {
                "-debug",
                "-target:library",
                "-out:" + this._island._output,
                "-x-type-inference-rule-attribute:" + typeof(TypeInferenceRuleAttribute)
            };

            foreach (string str in this._island._references)
            {
                arguments.Add("-r:" + ScriptCompilerBase.PrepareFileName(str));
            }
            foreach (string str2 in this._island._defines.Distinct <string>())
            {
                arguments.Add("-define:" + str2);
            }
            foreach (string str3 in this._island._files)
            {
                arguments.Add(ScriptCompilerBase.PrepareFileName(str3));
            }
            string compiler = Path.Combine(base.GetProfileDirectory(), "booc.exe");

            return(base.StartCompiler(this._island._target, compiler, arguments));
        }
        protected override Program StartCompiler()
        {
            List <string> arguments = new List <string>()
            {
                "-debug", "-target:library", "-i:UnityEngine", "-i:System.Collections", "-base:UnityEngine.MonoBehaviour", "-nowarn:BCW0016", "-nowarn:BCW0003", "-method:Main", "-out:" + this._island._output, "-x-type-inference-rule-attribute:" + (object)typeof(TypeInferenceRuleAttribute)
            };

            if (this.StrictBuildTarget())
            {
                arguments.Add("-pragmas:strict,downcast");
            }
            foreach (string str in ((IEnumerable <string>) this._island._defines).Distinct <string>())
            {
                arguments.Add("-define:" + str);
            }
            foreach (string reference in this._island._references)
            {
                arguments.Add("-r:" + ScriptCompilerBase.PrepareFileName(reference));
            }
            if (Array.Exists <string>(this._island._references, new Predicate <string>(UnityScriptCompiler.UnityEditorPattern.IsMatch)))
            {
                arguments.Add("-i:UnityEditor");
            }
            else if (!BuildPipeline.IsUnityScriptEvalSupported(this._island._target))
            {
                arguments.Add(string.Format("-disable-eval:eval is not supported on the current build target ({0}).", (object)this._island._target));
            }
            foreach (string file in this._island._files)
            {
                arguments.Add(ScriptCompilerBase.PrepareFileName(file));
            }
            return((Program)this.StartCompiler(this._island._target, Path.Combine(this.GetProfileDirectory(), "us.exe"), arguments));
        }
        protected override Program StartCompiler()
        {
            string        str  = ScriptCompilerBase.PrepareFileName(this._island._output);
            List <string> list = new List <string>
            {
                "/target:library",
                "/nowarn:0169",
                "/unsafe",
                "/out:" + str
            };

            if (!this._island._development_player)
            {
                list.Add("/debug:pdbonly");
                list.Add("/optimize+");
            }
            else
            {
                list.Add("/debug:full");
                list.Add("/optimize-");
            }
            string argsPrefix;

            this.FillCompilerOptions(list, out argsPrefix);
            return(this.StartCompilerImpl(list, argsPrefix));
        }
Beispiel #7
0
        protected override Program StartCompiler()
        {
            List <string> list = new List <string>
            {
                "-debug",
                "-target:library",
                "-nowarn:0169",
                "-langversion:4",
                "-out:" + ScriptCompilerBase.PrepareFileName(this._island._output),
                "-unsafe"
            };

            if (!this._island._development_player && !this._island._editor)
            {
                list.Add("-optimize");
            }
            string[] references = this._island._references;
            for (int i = 0; i < references.Length; i++)
            {
                string fileName = references[i];
                list.Add("-r:" + ScriptCompilerBase.PrepareFileName(fileName));
            }
            foreach (string current in this._island._defines.Distinct <string>())
            {
                list.Add("-define:" + current);
            }
            string[] files = this._island._files;
            for (int j = 0; j < files.Length; j++)
            {
                string fileName2 = files[j];
                list.Add(ScriptCompilerBase.PrepareFileName(fileName2));
            }
            string profile          = (this._island._api_compatibility_level != ApiCompatibilityLevel.NET_2_0) ? base.GetMonoProfileLibDirectory() : "2.0-api";
            string profileDirectory = MonoInstallationFinder.GetProfileDirectory(profile, "MonoBleedingEdge");

            string[] additionalReferences = this.GetAdditionalReferences();
            for (int k = 0; k < additionalReferences.Length; k++)
            {
                string path = additionalReferences[k];
                string text = Path.Combine(profileDirectory, path);
                if (File.Exists(text))
                {
                    list.Add("-r:" + ScriptCompilerBase.PrepareFileName(text));
                }
            }
            if (!base.AddCustomResponseFileIfPresent(list, "mcs.rsp"))
            {
                if (this._island._api_compatibility_level == ApiCompatibilityLevel.NET_2_0_Subset && base.AddCustomResponseFileIfPresent(list, "smcs.rsp"))
                {
                    Debug.LogWarning("Using obsolete custom response file 'smcs.rsp'. Please use 'mcs.rsp' instead.");
                }
                else if (this._island._api_compatibility_level == ApiCompatibilityLevel.NET_2_0 && base.AddCustomResponseFileIfPresent(list, "gmcs.rsp"))
                {
                    Debug.LogWarning("Using obsolete custom response file 'gmcs.rsp'. Please use 'mcs.rsp' instead.");
                }
            }
            return(base.StartCompiler(this._island._target, this.GetCompilerPath(list), list, false, MonoInstallationFinder.GetMonoInstallation("MonoBleedingEdge")));
        }
        protected override Program StartCompiler()
        {
            List <string> arguments = new List <string> {
                "-debug",
                "-target:library",
                "-i:UnityEngine",
                "-i:System.Collections",
                "-base:UnityEngine.MonoBehaviour",
                "-nowarn:BCW0016",
                "-nowarn:BCW0003",
                "-method:Main",
                "-out:" + this._island._output,
                "-x-type-inference-rule-attribute:" + typeof(TypeInferenceRuleAttribute)
            };

            if (this.StrictBuildTarget())
            {
                arguments.Add("-pragmas:strict,downcast");
            }
            IEnumerator <string> enumerator = this._island._defines.Distinct <string>().GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    arguments.Add("-define:" + enumerator.Current);
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            foreach (string str2 in this._island._references)
            {
                arguments.Add("-r:" + ScriptCompilerBase.PrepareFileName(str2));
            }
            if (Array.Exists <string>(this._island._references, new Predicate <string>(UnityEditorPattern.IsMatch)))
            {
                arguments.Add("-i:UnityEditor");
            }
            else if (!BuildPipeline.IsUnityScriptEvalSupported(this._island._target))
            {
                arguments.Add(string.Format("-disable-eval:eval is not supported on the current build target ({0}).", this._island._target));
            }
            foreach (string str3 in this._island._files)
            {
                arguments.Add(ScriptCompilerBase.PrepareFileName(str3));
            }
            string compiler = Path.Combine(base.GetProfileDirectory(), "us.exe");

            return(base.StartCompiler(this._island._target, compiler, arguments));
        }
        protected override Program StartCompiler()
        {
            List <string> list = new List <string>
            {
                "-debug",
                "-target:library",
                "-i:UnityEngine",
                "-i:System.Collections",
                "-base:UnityEngine.MonoBehaviour",
                "-nowarn:BCW0016",
                "-nowarn:BCW0003",
                "-method:Main",
                "-out:" + this._island._output,
                "-x-type-inference-rule-attribute:" + typeof(TypeInferenceRuleAttribute)
            };

            if (this.StrictBuildTarget())
            {
                list.Add("-pragmas:strict,downcast");
            }
            foreach (string current in this._island._defines.Distinct <string>())
            {
                list.Add("-define:" + current);
            }
            string[] references = this._island._references;
            for (int i = 0; i < references.Length; i++)
            {
                string fileName = references[i];
                list.Add("-r:" + ScriptCompilerBase.PrepareFileName(fileName));
            }
            bool flag = Array.Exists <string>(this._island._references, new Predicate <string>(UnityScriptCompiler.UnityEditorPattern.IsMatch));

            if (flag)
            {
                list.Add("-i:UnityEditor");
            }
            else
            {
                if (!BuildPipeline.IsUnityScriptEvalSupported(this._island._target))
                {
                    list.Add(string.Format("-disable-eval:eval is not supported on the current build target ({0}).", this._island._target));
                }
            }
            string[] files = this._island._files;
            for (int j = 0; j < files.Length; j++)
            {
                string fileName2 = files[j];
                list.Add(ScriptCompilerBase.PrepareFileName(fileName2));
            }
            string compiler = Path.Combine(base.GetProfileDirectory(), "us.exe");

            return(base.StartCompiler(this._island._target, compiler, list));
        }
        private Program StartCompilerImpl(List <string> arguments, string argsPrefix, bool msBuildCompiler)
        {
            string str4;

            foreach (string str in this._island._references)
            {
                arguments.Add("/reference:" + ScriptCompilerBase.PrepareFileName(str));
            }
            IEnumerator <string> enumerator = this._island._defines.Distinct <string>().GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    arguments.Add("/define:" + enumerator.Current);
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            foreach (string str3 in this._island._files)
            {
                arguments.Add(ScriptCompilerBase.PrepareFileName(str3).Replace('/', '\\'));
            }
            if (msBuildCompiler)
            {
                str4 = Path.Combine(ProgramFilesDirectory, @"MSBuild\14.0\Bin\csc.exe");
            }
            else
            {
                str4 = Path.Combine(WindowsDirectory, @"Microsoft.NET\Framework\v4.0.30319\Csc.exe");
            }
            if (!File.Exists(str4))
            {
                throw new Exception("'" + str4 + "' not found, either .NET 4.5 is not installed or your OS is not Windows 8/8.1.");
            }
            base.AddCustomResponseFileIfPresent(arguments, "csc.rsp");
            string           str5 = CommandLineFormatter.GenerateResponseFile(arguments);
            ProcessStartInfo si   = new ProcessStartInfo {
                Arguments      = argsPrefix + "@" + str5,
                FileName       = str4,
                CreateNoWindow = true
            };
            Program program = new Program(si);

            program.Start();
            return(program);
        }
        private string GetCompilerPath(List <string> arguments)
        {
            string profileDirectory = MonoInstallationFinder.GetProfileDirectory("4.5", "MonoBleedingEdge");
            string text             = Path.Combine(profileDirectory, "mcs.exe");

            if (File.Exists(text))
            {
                string profile = (this._island._api_compatibility_level != ApiCompatibilityLevel.NET_2_0) ? BuildPipeline.CompatibilityProfileToClassLibFolder(this._island._api_compatibility_level) : "2.0-api";
                if (this._island._api_compatibility_level != ApiCompatibilityLevel.NET_Standard_2_0)
                {
                    arguments.Add("-lib:" + ScriptCompilerBase.PrepareFileName(MonoInstallationFinder.GetProfileDirectory(profile, "MonoBleedingEdge")));
                }
                return(text);
            }
            throw new ApplicationException("Unable to find csharp compiler in " + profileDirectory);
        }
        protected override Program StartCompiler()
        {
            List <string> list = new List <string>
            {
                "-debug",
                "-target:library",
                "-nowarn:0169",
                "-langversion:" + ((EditorApplication.scriptingRuntimeVersion != ScriptingRuntimeVersion.Latest) ? "4" : "6"),
                "-out:" + ScriptCompilerBase.PrepareFileName(this._island._output),
                "-nostdlib",
                "-unsafe"
            };

            if (!this._island._development_player && !this._island._editor)
            {
                list.Add("-optimize");
            }
            string[] references = this._island._references;
            for (int i = 0; i < references.Length; i++)
            {
                string fileName = references[i];
                list.Add("-r:" + ScriptCompilerBase.PrepareFileName(fileName));
            }
            foreach (string current in this._island._defines.Distinct <string>())
            {
                list.Add("-define:" + current);
            }
            string[] files = this._island._files;
            for (int j = 0; j < files.Length; j++)
            {
                string fileName2 = files[j];
                list.Add(ScriptCompilerBase.PrepareFileName(fileName2));
            }
            if (!base.AddCustomResponseFileIfPresent(list, MonoCSharpCompiler.ReponseFilename))
            {
                if (this._island._api_compatibility_level == ApiCompatibilityLevel.NET_2_0_Subset && base.AddCustomResponseFileIfPresent(list, "smcs.rsp"))
                {
                    Debug.LogWarning(string.Format("Using obsolete custom response file 'smcs.rsp'. Please use '{0}' instead.", MonoCSharpCompiler.ReponseFilename));
                }
                else if (this._island._api_compatibility_level == ApiCompatibilityLevel.NET_2_0 && base.AddCustomResponseFileIfPresent(list, "gmcs.rsp"))
                {
                    Debug.LogWarning(string.Format("Using obsolete custom response file 'gmcs.rsp'. Please use '{0}' instead.", MonoCSharpCompiler.ReponseFilename));
                }
            }
            return(base.StartCompiler(this._island._target, this.GetCompilerPath(list), list, false, MonoInstallationFinder.GetMonoInstallation("MonoBleedingEdge")));
        }
        protected override Program StartCompiler()
        {
            string        str       = ScriptCompilerBase.PrepareFileName(this._island._output);
            List <string> arguments = new List <string>
            {
                "/debug:pdbonly",
                "/optimize+",
                "/target:library",
                "/nowarn:0169",
                "/unsafe",
                "/out:" + str
            };
            string argsPrefix;

            this.FillCompilerOptions(arguments, out argsPrefix);
            return(this.StartCompilerImpl(arguments, argsPrefix));
        }
Beispiel #14
0
        private Program StartCompilerImpl(List <string> arguments, string argsPrefix, bool msBuildCompiler)
        {
            string[] references = this._island._references;
            for (int i = 0; i < references.Length; i++)
            {
                string fileName = references[i];
                arguments.Add("/reference:" + ScriptCompilerBase.PrepareFileName(fileName));
            }
            foreach (string current in this._island._defines.Distinct <string>())
            {
                arguments.Add("/define:" + current);
            }
            string[] files = this._island._files;
            for (int j = 0; j < files.Length; j++)
            {
                string fileName2 = files[j];
                arguments.Add(ScriptCompilerBase.PrepareFileName(fileName2).Replace('/', '\\'));
            }
            string text;

            if (msBuildCompiler)
            {
                text = Path.Combine(MicrosoftCSharpCompiler.ProgramFilesDirectory, "MSBuild\\14.0\\Bin\\csc.exe");
            }
            else
            {
                text = Path.Combine(MicrosoftCSharpCompiler.WindowsDirectory, "Microsoft.NET\\Framework\\v4.0.30319\\Csc.exe");
            }
            if (!File.Exists(text))
            {
                throw new Exception("'" + text + "' not found, either .NET 4.5 is not installed or your OS is not Windows 8/8.1.");
            }
            base.AddCustomResponseFileIfPresent(arguments, "csc.rsp");
            string           str = CommandLineFormatter.GenerateResponseFile(arguments);
            ProcessStartInfo si  = new ProcessStartInfo
            {
                Arguments      = argsPrefix + "@" + str,
                FileName       = text,
                CreateNoWindow = true
            };
            Program program = new Program(si);

            program.Start();
            return(program);
        }
        protected override Program StartCompiler()
        {
            string        str       = ScriptCompilerBase.PrepareFileName(this._island._output);
            List <string> arguments = new List <string> {
                "/target:library",
                "/nowarn:0169",
                "/out:" + str
            };

            string[] collection = new string[] { "/debug:pdbonly", "/optimize+" };
            arguments.InsertRange(0, collection);
            string argsPrefix = string.Empty;

            if (base.CompilingForWSA() && ((PlayerSettings.WSA.compilationOverrides == PlayerSettings.WSACompilationOverrides.UseNetCore) || (PlayerSettings.WSA.compilationOverrides == PlayerSettings.WSACompilationOverrides.UseNetCorePartially)))
            {
                this.FillNETCoreCompilerOptions(EditorUserBuildSettings.wsaSDK, arguments, ref argsPrefix);
            }
            return(this.StartCompilerImpl(arguments, argsPrefix, EditorUserBuildSettings.wsaSDK == WSASDK.UWP));
        }
        protected override Program StartCompiler()
        {
            List <string> arguments = new List <string>()
            {
                "/target:library", "/nowarn:0169", "/out:" + ScriptCompilerBase.PrepareFileName(this._island._output)
            };

            arguments.InsertRange(0, (IEnumerable <string>) new string[2]
            {
                "/debug:pdbonly",
                "/optimize+"
            });
            string empty = string.Empty;

            if (this.CompilingForWSA() && (PlayerSettings.WSA.compilationOverrides == PlayerSettings.WSACompilationOverrides.UseNetCore || PlayerSettings.WSA.compilationOverrides == PlayerSettings.WSACompilationOverrides.UseNetCorePartially))
            {
                this.FillNETCoreCompilerOptions(EditorUserBuildSettings.wsaSDK, arguments, ref empty);
            }
            return(this.StartCompilerImpl(arguments, empty, EditorUserBuildSettings.wsaSDK == WSASDK.UWP));
        }
Beispiel #17
0
        protected override Program StartCompiler()
        {
            List <string> arguments = new List <string>()
            {
                "-debug", "-target:library", "-out:" + this._island._output, "-x-type-inference-rule-attribute:" + (object)typeof(TypeInferenceRuleAttribute)
            };

            foreach (string reference in this._island._references)
            {
                arguments.Add("-r:" + ScriptCompilerBase.PrepareFileName(reference));
            }
            foreach (string str in ((IEnumerable <string>) this._island._defines).Distinct <string>())
            {
                arguments.Add("-define:" + str);
            }
            foreach (string file in this._island._files)
            {
                arguments.Add(ScriptCompilerBase.PrepareFileName(file));
            }
            return((Program)this.StartCompiler(this._island._target, Path.Combine(this.GetProfileDirectory(), "booc.exe"), arguments));
        }
        protected override Program StartCompiler()
        {
            List <string> list = new List <string>
            {
                "-debug",
                "-target:library",
                "-nowarn:0169",
                "-out:" + ScriptCompilerBase.PrepareFileName(this._island._output)
            };

            string[] references = this._island._references;
            for (int i = 0; i < references.Length; i++)
            {
                string fileName = references[i];
                list.Add("-r:" + ScriptCompilerBase.PrepareFileName(fileName));
            }
            foreach (string current in this._island._defines.Distinct <string>())
            {
                list.Add("-define:" + current);
            }
            string[] files = this._island._files;
            for (int j = 0; j < files.Length; j++)
            {
                string fileName2 = files[j];
                list.Add(ScriptCompilerBase.PrepareFileName(fileName2));
            }
            string[] additionalReferences = this.GetAdditionalReferences();
            for (int k = 0; k < additionalReferences.Length; k++)
            {
                string path = additionalReferences[k];
                string text = Path.Combine(base.GetProfileDirectory(), path);
                if (File.Exists(text))
                {
                    list.Add("-r:" + ScriptCompilerBase.PrepareFileName(text));
                }
            }
            return(base.StartCompiler(this._island._target, this.GetCompilerPath(list), list));
        }
        protected override Program StartCompiler()
        {
            string        str  = ScriptCompilerBase.PrepareFileName(this._island._output);
            List <string> list = new List <string>
            {
                "/target:library",
                "/nowarn:0169",
                "/out:" + str
            };

            list.InsertRange(0, new string[]
            {
                "/debug:pdbonly",
                "/optimize+"
            });
            string empty = string.Empty;

            if (base.CompilingForWSA() && (PlayerSettings.WSA.compilationOverrides == PlayerSettings.WSACompilationOverrides.UseNetCore || PlayerSettings.WSA.compilationOverrides == PlayerSettings.WSACompilationOverrides.UseNetCorePartially))
            {
                this.FillNETCoreCompilerOptions(EditorUserBuildSettings.wsaSDK, list, ref empty);
            }
            return(this.StartCompilerImpl(list, empty, EditorUserBuildSettings.wsaSDK == WSASDK.UWP));
        }
Beispiel #20
0
        protected override Program StartCompiler()
        {
            List <string> arguments = new List <string> {
                "-debug",
                "-target:library",
                "-out:" + this._island._output,
                "-x-type-inference-rule-attribute:" + typeof(TypeInferenceRuleAttribute)
            };

            foreach (string str in this._island._references)
            {
                arguments.Add("-r:" + ScriptCompilerBase.PrepareFileName(str));
            }
            IEnumerator <string> enumerator = this._island._defines.Distinct <string>().GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    arguments.Add("-define:" + enumerator.Current);
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            foreach (string str3 in this._island._files)
            {
                arguments.Add(ScriptCompilerBase.PrepareFileName(str3));
            }
            string compiler = Path.Combine(base.GetProfileDirectory(), "booc.exe");

            return(base.StartCompiler(this._island._target, compiler, arguments));
        }
        private Program StartCompilerImpl(List <string> arguments, string argsPrefix)
        {
            string[] references = this._island._references;
            for (int i = 0; i < references.Length; i++)
            {
                string fileName = references[i];
                arguments.Add("/reference:" + ScriptCompilerBase.PrepareFileName(fileName));
            }
            foreach (string current in this._island._defines.Distinct <string>())
            {
                arguments.Add("/define:" + current);
            }
            string[] files = this._island._files;
            for (int j = 0; j < files.Length; j++)
            {
                string fileName2 = files[j];
                arguments.Add(ScriptCompilerBase.PrepareFileName(fileName2).Replace('/', '\\'));
            }
            string text = Paths.Combine(new string[]
            {
                EditorApplication.applicationContentsPath,
                "Tools",
                "Roslyn",
                "CoreRun.exe"
            }).Replace('/', '\\');
            string text2 = Paths.Combine(new string[]
            {
                EditorApplication.applicationContentsPath,
                "Tools",
                "Roslyn",
                "csc.exe"
            }).Replace('/', '\\');

            if (!File.Exists(text))
            {
                MicrosoftCSharpCompiler.ThrowCompilerNotFoundException(text);
            }
            if (!File.Exists(text2))
            {
                MicrosoftCSharpCompiler.ThrowCompilerNotFoundException(text2);
            }
            base.AddCustomResponseFileIfPresent(arguments, "csc.rsp");
            string           text3 = CommandLineFormatter.GenerateResponseFile(arguments);
            ProcessStartInfo si    = new ProcessStartInfo
            {
                Arguments = string.Concat(new string[]
                {
                    "\"",
                    text2,
                    "\" ",
                    argsPrefix,
                    "@",
                    text3
                }),
                FileName       = text,
                CreateNoWindow = true
            };
            Program program = new Program(si);

            program.Start();
            return(program);
        }