mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
C#: Change RestoreSettings to have general extraArgs parameter
This allows the string of package feeds to be constructed once and used repeatedly in the parallel restore loop as well.
This commit is contained in:
@@ -67,19 +67,6 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
args += $" --configfile \"{restoreSettings.PathToNugetConfig}\"";
|
||||
}
|
||||
|
||||
// Add package sources. If any are present, they override all sources specified in
|
||||
// the configuration file(s).
|
||||
if (restoreSettings.Sources != null)
|
||||
{
|
||||
var feedArgs = new StringBuilder();
|
||||
foreach (string source in restoreSettings.Sources)
|
||||
{
|
||||
feedArgs.Append($" -s {source}");
|
||||
}
|
||||
|
||||
args += feedArgs.ToString();
|
||||
}
|
||||
|
||||
if (restoreSettings.ForceReevaluation)
|
||||
{
|
||||
args += " --force";
|
||||
@@ -90,6 +77,11 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
args += " /p:EnableWindowsTargeting=true";
|
||||
}
|
||||
|
||||
if (restoreSettings.ExtraArgs != null)
|
||||
{
|
||||
args += $" {restoreSettings.ExtraArgs}";
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user