Пример #1
0
        public CompilerResults CompileAssemblyFromFileBatch(CompilerParameters options, string[] fileNames)
        {
            if (options.BuildExe)
            {
                return(CompileAssemblyFromFileBatch_with_Build(options, fileNames)); // csc.exe does not support building self sufficient executables
            }
            else
            {
                switch (CSExecutor.options.compilerEngine)
                {
                case Directives.compiler_dotnet:
                    return(CompileAssemblyFromFileBatch_with_Build(options, fileNames));

                case Directives.compiler_csc:
                    return(CompileAssemblyFromFileBatch_with_Csc(options, fileNames));

                case Directives.compiler_roslyn:
                    return(RoslynService.CompileAssemblyFromFileBatch_with_roslyn(options, fileNames, false));

                case Directives.compiler_roslyn_inproc:
                    return(RoslynService.CompileAssemblyFromFileBatch_with_roslyn(options, fileNames, true));

                default:
                    return(CompileAssemblyFromFileBatch_with_Build(options, fileNames));
                }
            }
        }
Пример #2
0
 public CompilerResults CompileAssemblyFromFileBatch(CompilerParameters options, string[] fileNames)
 {
     // csc();
     // RoslynService.CompileAssemblyFromFileBatch_with_roslyn(options, fileNames);
     return(RoslynService.CompileAssemblyFromFileBatch_with_roslyn(options, fileNames));
     // return CompileAssemblyFromFileBatch_with_Csc(options, fileNames);
     // return CompileAssemblyFromFileBatch_with_Build(options, fileNames);
 }
Пример #3
0
        public static void Start()
        {
            // Task.Run(() =>
            Profiler.measure(">> Initialized: ", () => RoslynService.Init());

            try
            {
                var serverSocket = new TcpListener(IPAddress.Loopback, serverPort);
                serverSocket.Start();

                while (true)
                {
                    using (TcpClient clientSocket = serverSocket.AcceptTcpClient())
                    {
                        try
                        {
                            string request = clientSocket.ReadAllText();

                            if (request == "-exit")
                            {
                                try { clientSocket.WriteAllText("Bye"); } catch { }
                                break;
                            }

                            Profiler.measure(">> Processing client request: ", () =>
                            {
                                string response = RoslynService.process_build_remotelly_request(request);
                                clientSocket.WriteAllText(response);
                            });
                        }
                        catch (Exception e)
                        {
                            WriteLine(e.Message);
                        }
                    }
                }

                serverSocket.Stop();
                WriteLine(" >> exit");
            }
            catch (SocketException e)
            {
                if (e.ErrorCode == 10048)
                {
                    WriteLine(">" + e.Message);
                }
                else
                {
                    WriteLine(e.Message);
                }
            }
            catch (Exception e)
            {
                WriteLine(e);
            }
        }
Пример #4
0
        public CompilerResults CompileAssemblyFromFileBatch(CompilerParameters options, string[] fileNames)
        {
            switch (CSExecutor.options.compilerEngine)
            {
            case "csc":
                return(CompileAssemblyFromFileBatch_with_Csc(options, fileNames));

            case "roslyn":
                return(RoslynService.CompileAssemblyFromFileBatch_with_roslyn(options, fileNames));

            case "dotnet":
                return(CompileAssemblyFromFileBatch_with_Build(options, fileNames));

            default:
                return(CompileAssemblyFromFileBatch_with_Build(options, fileNames));
            }
        }
Пример #5
0
        public CompilerResults CompileAssemblyFromFileBatch(CompilerParameters options, string[] fileNames)
        {
            switch (CSExecutor.options.compilerEngine)
            {
            case Directives.compiler_roslyn:
                return(RoslynService.CompileAssemblyFromFileBatch_with_roslyn(options, fileNames));

            case Directives.compiler_dotnet:
                return(CompileAssemblyFromFileBatch_with_Build(options, fileNames));

            case Directives.compiler_csc:
                return(CompileAssemblyFromFileBatch_with_Csc(options, fileNames));

            default:
                // return RoslynService.CompileAssemblyFromFileBatch_with_roslyn(options, fileNames);
                // return CompileAssemblyFromFileBatch_with_Csc(options, fileNames);
                return(CompileAssemblyFromFileBatch_with_Build(options, fileNames));
            }
        }