Beispiel #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
                       ));
        }
 private static BuildPaths CreateBuildPaths(string workingDirectory, string sdkDirectory = null) => RuntimeUtilities.CreateBuildPaths(workingDirectory, sdkDirectory);
Beispiel #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));
        }