Ejemplo n.º 1
0
        // Original csc Run() function

        /*
         * internal static int Run(string[] args, BuildPaths buildPaths, TextWriter textWriter, IAnalyzerAssemblyLoader analyzerLoader)
         * {
         *  FatalError.Handler = FailFast.OnFatalException;
         *
         *  var responseFile = Path.Combine(buildPaths.ClientDirectory, CSharpCompiler.ResponseFileName);
         *  var compiler = new Xsc(responseFile, buildPaths, args, analyzerLoader);
         *  return ConsoleUtil.RunWithUtf8Output(compiler.Arguments.Utf8Output, textWriter, tw => compiler.Run(tw));
         * }
         */


        internal static int Run(string[] args, BuildPaths buildPaths, TextWriter textWriter, IAnalyzerAssemblyLoader analyzerLoader)
        {
            FatalError.Handler = FailFast.OnFatalException;
            string[] paths = GetPaths();
            XSharpSpecificCompilationOptions.SetDefaultIncludeDir(paths[0]);
            XSharpSpecificCompilationOptions.SetWinDir(paths[1]);
            XSharpSpecificCompilationOptions.SetSysDir(paths[2]);
            var responseFile = Path.Combine(buildPaths.ClientDirectory, CSharpCompiler.ResponseFileName);
            var compiler     = new Xsc(responseFile, buildPaths, args, analyzerLoader);
            var result       = ConsoleUtil.RunWithUtf8Output(compiler.Arguments.Utf8Output, textWriter, tw => compiler.Run(tw));

            return(result);
        }
Ejemplo n.º 2
0
 public static int Run(string[] args, string clientDir, string workingDir, string sdkDir, string tempDir, TextWriter textWriter, IAnalyzerAssemblyLoader analyzerLoader)
 => Xsc.Run(args, new BuildPaths(clientDir: clientDir, workingDir: workingDir, sdkDir: sdkDir, tempDir: tempDir), textWriter, analyzerLoader);