public MockCSharpCompiler(string responseFile, BuildPaths buildPaths, string[] args, ImmutableArray <DiagnosticAnalyzer> analyzers = default, ImmutableArray <ISourceGenerator> generators = default, AnalyzerAssemblyLoader loader = null)
     : base(CSharpCommandLineParser.Default, responseFile, args, buildPaths, Environment.GetEnvironmentVariable("LIB"), loader ?? new DefaultAnalyzerAssemblyLoader())
 {
     _analyzers  = analyzers.NullToEmpty();
     _generators = generators.NullToEmpty();
 }
Beispiel #2
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));
        }
 public MockCSharpCompiler(string responseFile, string workingDirectory, string[] args, ImmutableArray <DiagnosticAnalyzer> analyzers = default, ImmutableArray <ISourceGenerator> generators = default, AnalyzerAssemblyLoader loader = null)
     : this(responseFile, CreateBuildPaths(workingDirectory), args, analyzers, generators, loader)
 {
 }
Beispiel #4
0
 internal MockCSharpCompiler CreateCSharpCompiler(string[] args, ImmutableArray <DiagnosticAnalyzer> analyzers = default, ImmutableArray <ISourceGenerator> generators = default, AnalyzerAssemblyLoader loader = null)
 {
     return(CreateCSharpCompiler(null, WorkingDirectory, args, analyzers, generators, loader));
 }