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
                       ));
        }
Exemple #2
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));
        }
Exemple #3
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));
        }