Skip to content

Commit 8fe9933

Browse files
committed
C#: Remove the dotnet restore config file option,
1 parent eb241dc commit 8fe9933

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ private string GetRestoreArgs(RestoreSettings restoreSettings)
8080
args += $" /p:TargetFrameworkRootPath=\"{path}\" /p:NetCoreTargetingPackRoot=\"{path}\" /p:AllowMissingPrunePackageData=true";
8181
}
8282

83-
if (restoreSettings.PathToNugetConfig != null)
84-
{
85-
args += $" --configfile \"{restoreSettings.PathToNugetConfig}\"";
86-
}
87-
8883
if (restoreSettings.ForceReevaluation)
8984
{
9085
args += " --force";

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/IDotNet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public interface IDotNet
1717
IList<string> GetNugetFeedsFromFolder(string folderPath);
1818
}
1919

20-
public record class RestoreSettings(string File, string PackageDirectory, bool ForceDotnetRefAssemblyFetching, string? NugetSources = null, string? PathToNugetConfig = null, bool ForceReevaluation = false, bool TargetWindows = false);
20+
public record class RestoreSettings(string File, string PackageDirectory, bool ForceDotnetRefAssemblyFetching, string? NugetSources = null, bool ForceReevaluation = false, bool TargetWindows = false);
2121

2222
public partial record class RestoreResult(bool Success, IList<string> Output)
2323
{

csharp/extractor/Semmle.Extraction.Tests/DotNet.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ public void TestDotnetRestoreProjectToDirectory2()
130130
var dotnet = MakeDotnet(dotnetCliInvoker);
131131

132132
// Execute
133-
var res = dotnet.Restore(new("myproject.csproj", "mypackages", false, null, "myconfig.config"));
133+
var res = dotnet.Restore(new("myproject.csproj", "mypackages", false, null));
134134

135135
// Verify
136136
var lastArgs = dotnetCliInvoker.GetLastArgs();
137-
Assert.Equal("restore --no-dependencies \"myproject.csproj\" --packages \"mypackages\" /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile \"myconfig.config\"", lastArgs);
137+
Assert.Equal("restore --no-dependencies \"myproject.csproj\" --packages \"mypackages\" /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal", lastArgs);
138138
Assert.Equal(2, res.AssetsFilePaths.Count());
139139
Assert.Contains("/path/to/project.assets.json", res.AssetsFilePaths);
140140
Assert.Contains("/path/to/project2.assets.json", res.AssetsFilePaths);
@@ -148,11 +148,11 @@ public void TestDotnetRestoreProjectToDirectory3()
148148
var dotnet = MakeDotnet(dotnetCliInvoker);
149149

150150
// Execute
151-
var res = dotnet.Restore(new("myproject.csproj", "mypackages", false, null, "myconfig.config", true));
151+
var res = dotnet.Restore(new("myproject.csproj", "mypackages", false, null, true));
152152

153153
// Verify
154154
var lastArgs = dotnetCliInvoker.GetLastArgs();
155-
Assert.Equal("restore --no-dependencies \"myproject.csproj\" --packages \"mypackages\" /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile \"myconfig.config\" --force", lastArgs);
155+
Assert.Equal("restore --no-dependencies \"myproject.csproj\" --packages \"mypackages\" /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --force", lastArgs);
156156
Assert.Equal(2, res.AssetsFilePaths.Count());
157157
Assert.Contains("/path/to/project.assets.json", res.AssetsFilePaths);
158158
Assert.Contains("/path/to/project2.assets.json", res.AssetsFilePaths);

0 commit comments

Comments
 (0)