Skip to content

Commit 737d7b5

Browse files
committed
Use project name
1 parent 88e8ee0 commit 737d7b5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

StyleCop.Analyzers.Status.Generator/SolutionReader.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ private SolutionReader()
3939

4040
private string SlnPath { get; set; }
4141

42+
private string ProjectName { get; set; }
43+
4244
private ImmutableArray<CodeFixProvider> CodeFixProviders { get; set; }
4345

4446
/// <summary>
@@ -49,9 +51,11 @@ private SolutionReader()
4951
/// <returns>A <see cref="Task{SolutionReader}"/> representing the asynchronous operation</returns>
5052
public static async Task<SolutionReader> CreateAsync(string pathToSln, string projectName = "StyleCop.Analyzers")
5153
{
54+
5255
SolutionReader reader = new SolutionReader();
5356

5457
reader.SlnPath = pathToSln;
58+
reader.ProjectName = projectName;
5559
reader.workspace = MSBuildWorkspace.Create(properties: new Dictionary<string, string> { { "Configuration", "Release" } });
5660

5761
await reader.InitializeAsync();
@@ -62,7 +66,7 @@ public static async Task<SolutionReader> CreateAsync(string pathToSln, string pr
6266
private async Task InitializeAsync()
6367
{
6468
this.solution = await this.workspace.OpenSolutionAsync(this.SlnPath);
65-
this.project = this.solution.Projects.Single(x => x.Name == "StyleCop.Analyzers");
69+
this.project = this.solution.Projects.Single(x => x.Name == this.ProjectName);
6670
this.compilation = await this.project.GetCompilationAsync();
6771
this.compilation = this.compilation.WithOptions(this.compilation.Options.WithOutputKind(OutputKind.DynamicallyLinkedLibrary));
6872
this.booleanType = this.compilation.GetSpecialType(SpecialType.System_Boolean);

0 commit comments

Comments
 (0)