예제 #1
0
        private static CommandLineRunner CreateRunner(string[] args = null, string input = "", string responseFile = null)
        {
            var io = new TestConsoleIO(input);

            var compiler = new CSharpInteractiveCompiler(
                responseFile,
                AppContext.BaseDirectory,
                args ?? Array.Empty <string>(),
                new NotImplementedAnalyzerLoader());

            return(new CommandLineRunner(io, compiler, CSharpScriptCompiler.Instance, CSharpObjectFormatter.Instance));
        }
예제 #2
0
        private static CommandLineRunner CreateRunner(
            string[] args           = null,
            string input            = "",
            string responseFile     = null,
            string workingDirectory = null)
        {
            var io         = new TestConsoleIO(input);
            var buildPaths = new BuildPaths(
                clientDir: AppContext.BaseDirectory,
                workingDir: workingDirectory ?? AppContext.BaseDirectory,
                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));
        }