Skip to content

Commit

Permalink
fix: add more source generator path heuristics
Browse files Browse the repository at this point in the history
should work out how to definitively find them
  • Loading branch information
rdavisau committed Jan 12, 2023
1 parent 2fa24d8 commit 885fc83
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -68,9 +68,11 @@ public SourceGeneratorResolver(ILogger<SourceGeneratorResolver> logger, IFileSys
Diags: ImmutableDictionary.Create<string, object>());
}

var searches = new[] { "roslyn4.0/cs", "roslyn4.0\\cs", "analyzers/dotnet/cs", "analyzers\\dotnet\\cs" };

var nugetPath = _fileSystem.Path.Combine(GetNugetPackageCachePath, package, version);
var dllPaths = _fileSystem.Directory.GetFiles(nugetPath, "*.dll", SearchOption.AllDirectories)
.Where(x => x.Contains("roslyn4.0/cs", StringComparison.InvariantCultureIgnoreCase) || x.Contains("roslyn4.0\\cs", StringComparison.InvariantCultureIgnoreCase));
.Where(x => searches.Any(s => x.Contains(s, StringComparison.InvariantCultureIgnoreCase)));

return Enumerable.Aggregate(
dllPaths,
Expand Down

0 comments on commit 885fc83

Please sign in to comment.