C#: Do not download Microsoft.CodeAnalysis.ResxSourceGenerator when there are no resx files to process

This commit is contained in:
Tamas Vajk
2024-04-24 11:53:26 +02:00
parent de58ee5a22
commit 88e67715a1

View File

@@ -19,6 +19,13 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
TemporaryDirectory tempWorkingDirectory,
IEnumerable<string> references) : base(fileProvider, fileContent, dotnet, compilationInfoContainer, logger, tempWorkingDirectory, references)
{
if (fileProvider.Resources.Count == 0)
{
logger.LogDebug("No resources found, skipping resource extraction.");
sourceGeneratorFolder = null;
return;
}
try
{
// The package is downloaded to `missingpackages`, which is okay, we're already after the DLL collection phase.