Skip to content

Commit 3b44b13

Browse files
authored
Merge pull request #16311 from tamasvajk/fix/resx
C#: Do not download `Microsoft.CodeAnalysis.ResxSourceGenerator` when…
2 parents 84ea3a9 + 88e6771 commit 3b44b13

File tree

1 file changed

+7
-0
lines changed
  • csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/SourceGenerators

1 file changed

+7
-0
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/SourceGenerators/ResxGenerator.cs

+7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ public ResxGenerator(
1919
TemporaryDirectory tempWorkingDirectory,
2020
IEnumerable<string> references) : base(fileProvider, fileContent, dotnet, compilationInfoContainer, logger, tempWorkingDirectory, references)
2121
{
22+
if (fileProvider.Resources.Count == 0)
23+
{
24+
logger.LogDebug("No resources found, skipping resource extraction.");
25+
sourceGeneratorFolder = null;
26+
return;
27+
}
28+
2229
try
2330
{
2431
// The package is downloaded to `missingpackages`, which is okay, we're already after the DLL collection phase.

0 commit comments

Comments
 (0)