mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Allow specifying package feeds for dotnet restore as command line arguments
This commit is contained in:
@@ -67,6 +67,16 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
|||||||
args += $" --configfile \"{restoreSettings.PathToNugetConfig}\"";
|
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)
|
||||||
|
{
|
||||||
|
foreach (string source in restoreSettings.Sources)
|
||||||
|
{
|
||||||
|
args += $" -s {source}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (restoreSettings.ForceReevaluation)
|
if (restoreSettings.ForceReevaluation)
|
||||||
{
|
{
|
||||||
args += " --force";
|
args += " --force";
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
|||||||
IList<string> GetNugetFeedsFromFolder(string folderPath);
|
IList<string> GetNugetFeedsFromFolder(string folderPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public record class RestoreSettings(string File, string PackageDirectory, bool ForceDotnetRefAssemblyFetching, string? PathToNugetConfig = null, bool ForceReevaluation = false, bool TargetWindows = false);
|
public record class RestoreSettings(string File, string PackageDirectory, bool ForceDotnetRefAssemblyFetching, IList<string>? Sources = null, string? PathToNugetConfig = null, bool ForceReevaluation = false, bool TargetWindows = false);
|
||||||
|
|
||||||
public partial record class RestoreResult(bool Success, IList<string> Output)
|
public partial record class RestoreResult(bool Success, IList<string> Output)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user