Exemplo n.º 1
0
        internal MockCSharpCompiler CreateCSharpCompiler(
            string responseFile,
            string workingDirectory,
            string[] args,
            ImmutableArray <DiagnosticAnalyzer> analyzers = default,
            ImmutableArray <ISourceGenerator> generators  = default,
            AnalyzerAssemblyLoader loader = null
            )
        {
            var buildPaths = RuntimeUtilities.CreateBuildPaths(
                workingDirectory,
                sdkDirectory: SdkDirectory
                );

            return(new MockCSharpCompiler(
                       responseFile,
                       buildPaths,
                       args,
                       analyzers,
                       generators,
                       loader
                       ));
        }
Exemplo n.º 2
0
 private static BuildPaths CreateBuildPaths(string workingDirectory, string sdkDirectory = null) => RuntimeUtilities.CreateBuildPaths(workingDirectory, sdkDirectory);
Exemplo n.º 3
0
        internal MockCSharpCompiler CreateCSharpCompiler(string?responseFile, string workingDirectory, string[] args, DiagnosticAnalyzer[]?analyzers = null, ISourceGenerator[]?generators = null, AnalyzerAssemblyLoader?loader = null, GeneratorDriverCache?driverCache = null)
        {
            var buildPaths = RuntimeUtilities.CreateBuildPaths(workingDirectory, sdkDirectory: SdkDirectory);

            return(new MockCSharpCompiler(responseFile, buildPaths, args, analyzers.AsImmutableOrEmpty(), generators.AsImmutableOrEmpty(), loader, driverCache));
        }