Beispiel #1
0
 internal static int Run(IEnumerable<string> arguments, IEnumerable<string> extraArguments, RequestLanguage language, CompileFunc compileFunc, IAnalyzerAssemblyLoader analyzerAssemblyLoader)
 {
     var client = new DesktopBuildClient(language, compileFunc, analyzerAssemblyLoader);
     var clientDir = AppDomain.CurrentDomain.BaseDirectory;
     var sdkDir = RuntimeEnvironment.GetRuntimeDirectory();
     var workingDir = Directory.GetCurrentDirectory();
     var buildPaths = new BuildPaths(clientDir: clientDir, workingDir: workingDir, sdkDir: sdkDir);
     var originalArguments = BuildClient.GetCommandLineArgs(arguments).Concat(extraArguments).ToArray();
     return client.RunCompilation(originalArguments, buildPaths).ExitCode;
 }
Beispiel #2
0
        internal static int Run(IEnumerable <string> arguments, IEnumerable <string> extraArguments, RequestLanguage language, CompileFunc compileFunc, IAnalyzerAssemblyLoader analyzerAssemblyLoader)
        {
            var client            = new DesktopBuildClient(language, compileFunc, analyzerAssemblyLoader);
            var clientDir         = AppDomain.CurrentDomain.BaseDirectory;
            var sdkDir            = RuntimeEnvironment.GetRuntimeDirectory();
            var workingDir        = Directory.GetCurrentDirectory();
            var buildPaths        = new BuildPaths(clientDir: clientDir, workingDir: workingDir, sdkDir: sdkDir);
            var originalArguments = BuildClient.GetCommandLineArgs(arguments).Concat(extraArguments).ToArray();

            return(client.RunCompilation(originalArguments, buildPaths).ExitCode);
        }
Beispiel #3
0
        internal static int Run(IEnumerable <string> arguments, RequestLanguage language, CompileFunc compileFunc, IAnalyzerAssemblyLoader analyzerAssemblyLoader)
        {
            var client            = new DesktopBuildClient(language, compileFunc, analyzerAssemblyLoader);
            var clientDir         = AppContext.BaseDirectory;
            var sdkDir            = GetRuntimeDirectoryOpt();
            var workingDir        = Directory.GetCurrentDirectory();
            var tempDir           = BuildServerConnection.GetTempPath(workingDir);
            var buildPaths        = new BuildPaths(clientDir: clientDir, workingDir: workingDir, sdkDir: sdkDir, tempDir: tempDir);
            var originalArguments = GetCommandLineArgs(arguments).ToArray();

            return(client.RunCompilation(originalArguments, buildPaths).ExitCode);
        }
Beispiel #4
0
        internal static int Run(IEnumerable <string> arguments, RequestLanguage language, CompileFunc compileFunc, IAnalyzerAssemblyLoader analyzerAssemblyLoader)
        {
            var sdkDir = GetSystemSdkDirectory();

            if (RuntimeHostInfo.IsCoreClrRuntime)
            {
                // Register encodings for console
                // https://github.com/dotnet/roslyn/issues/10785
                System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
            }

            var client            = new DesktopBuildClient(language, compileFunc, analyzerAssemblyLoader);
            var clientDir         = AppContext.BaseDirectory;
            var workingDir        = Directory.GetCurrentDirectory();
            var tempDir           = BuildServerConnection.GetTempPath(workingDir);
            var buildPaths        = new BuildPaths(clientDir: clientDir, workingDir: workingDir, sdkDir: sdkDir, tempDir: tempDir);
            var originalArguments = GetCommandLineArgs(arguments);

            return(client.RunCompilation(originalArguments, buildPaths).ExitCode);
        }