Beispiel #1
0
        private static CommandLineRunner CreateRunner(
            string[] args           = null,
            string input            = "",
            string responseFile     = null,
            string workingDirectory = null
            )
        {
            var io        = new TestConsoleIO(input);
            var clientDir = Path.GetDirectoryName(
                RuntimeUtilities.GetAssemblyLocation(typeof(CommandLineRunnerTests))
                );
            var buildPaths = new BuildPaths(
                clientDir: clientDir,
                workingDir: workingDirectory ?? clientDir,
                sdkDir: null,
                tempDir: Path.GetTempPath()
                );

            var compiler = new CSharpInteractiveCompiler(
                responseFile,
                buildPaths,
                args?.Where(a => a != null).ToArray() ?? s_defaultArgs,
                new NotImplementedAnalyzerLoader()
                );

            return(new CommandLineRunner(
                       io,
                       compiler,
                       CSharpScriptCompiler.Instance,
                       CSharpObjectFormatter.Instance
                       ));
        }