public static Assembly  compile(this string pathToFileToCompile, bool generateDebugSymbols)
        {
            PublicDI.CurrentScript = pathToFileToCompile;
            var csharpCompiler = new CSharp_FastCompiler().generateDebugSymbols(generateDebugSymbols);
            var compileProcess = new AutoResetEvent(false);

            csharpCompiler.set_OnCompileFail(() => compileProcess.Set());
            csharpCompiler.set_OnCompileOK(() => compileProcess.Set());

            O2Thread.mtaThread(() => csharpCompiler.compileSourceCode(pathToFileToCompile.contents()));
            compileProcess.WaitOne();
            return(csharpCompiler.assembly());
        }
Пример #2
0
        public static Assembly compile(this string pathToFileToCompile, bool generateDebugSymbols)
        {
            PublicDI.CurrentScript = pathToFileToCompile;
            var csharpCompiler = new CSharp_FastCompiler();

            csharpCompiler.generateDebugSymbols = generateDebugSymbols;
            var compileProcess = new System.Threading.AutoResetEvent(false);

            csharpCompiler.compileSourceCode(pathToFileToCompile.contents());
            csharpCompiler.onCompileFail = () => compileProcess.Set();
            csharpCompiler.onCompileOK   = () => compileProcess.Set();
            compileProcess.WaitOne();
            return(csharpCompiler.assembly());
        }
        public static Assembly  compile_CodeSnippet(this string codeSnipptet, bool generateDebugSymbols)
        {
            //Note we can't use the precompiled engines here since there is an issue of the resolution of this code dependencies

            var csharpCompiler = new CSharp_FastCompiler().debugMode(true)
                                 .generateDebugSymbols(generateDebugSymbols);
            var compileProcess = new AutoResetEvent(false);

            csharpCompiler.set_OnAstFail(() => compileProcess.Set());
            csharpCompiler.set_OnCompileFail(() => compileProcess.Set());
            csharpCompiler.set_OnCompileOK(() => compileProcess.Set());
            csharpCompiler.compileSnippet(codeSnipptet);
            compileProcess.WaitOne();
            var assembly = csharpCompiler.assembly();

            return(assembly);
        }
Пример #4
0
        public static Assembly compile_CodeSnippet(this string codeSnipptet, bool generateDebugSymbols)
        {
            //Note we can't use the precompiled engines here since there is an issue of the resolution of this code dependencies

            var csharpCompiler = new CSharp_FastCompiler();

            csharpCompiler.generateDebugSymbols = generateDebugSymbols;
            var compileProcess = new System.Threading.AutoResetEvent(false);

            //csharpCompiler.compileSourceCode(pathToFileToCompile.contents());
            csharpCompiler.compileSnippet(codeSnipptet);
            csharpCompiler.onCompileFail = () => compileProcess.Set();
            csharpCompiler.onCompileOK   = () => compileProcess.Set();
            compileProcess.WaitOne();
            var assembly = csharpCompiler.assembly();

            return(assembly);
        }