Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void RunCSharpCompiler(BoltCompilerOperation op, ManualResetEvent evnt)
- {
- string str = "\"{0}\" -out:\"{1}\" {2} -platform:anycpu -target:library -debug+ -optimize- -warn:{3} ";
- if (BoltCore.get_isDebugMode())
- {
- str += "-define:DEBUG ";
- }
- if (BoltUserAssemblyCompiler.isUnity5)
- {
- str += "-sdk:2 ";
- }
- Process p = new Process();
- p.StartInfo.FileName = BoltUserAssemblyCompiler.monoPath;
- p.StartInfo.Arguments = string.Format(str + BoltUserAssemblyCompiler.sourceFileList, new object[]
- {
- BoltUserAssemblyCompiler.csharpCompilerPath,
- BoltUserAssemblyCompiler.boltUserAssemblyPath,
- BoltUserAssemblyCompiler.assemblyReferencesList,
- Mathf.Clamp(BoltRuntimeSettings.get_instance().compilationWarnLevel, 0, 4)
- });
- p.EnableRaisingEvents = true;
- p.StartInfo.CreateNoWindow = true;
- p.StartInfo.UseShellExecute = false;
- p.StartInfo.RedirectStandardError = true;
- p.StartInfo.RedirectStandardOutput = true;
- p.ErrorDataReceived += new DataReceivedEventHandler(BoltUserAssemblyCompiler.ErrorDataReceived);
- p.OutputDataReceived += new DataReceivedEventHandler(BoltUserAssemblyCompiler.OutputDataReceived);
- p.Exited += delegate(object s, EventArgs ea)
- {
- evnt.Set();
- EditorHousekeeping.Invoke(delegate
- {
- if (p.ExitCode == 0)
- {
- BoltUserAssemblyCompiler.CompilationDone(op);
- }
- });
- };
- p.Start();
- p.BeginErrorReadLine();
- p.BeginOutputReadLine();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement