Skip to content

Commit a966c0e

Browse files
committed
C#: Do not include the mscorlib assembly and remove the option.
1 parent 44a83a7 commit a966c0e

File tree

4 files changed

+3
-21
lines changed

4 files changed

+3
-21
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ public DependencyManager(string srcDir, IDependencyOptions options, ILogger logg
8585
}
8686
}
8787

88-
if (options.UseMscorlib)
89-
{
90-
UseReference(typeof(object).Assembly.Location);
91-
}
92-
9388
if (options.UseNuGet)
9489
{
9590
dllDirNames.Add(packageDirectory.DirInfo.FullName);

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ public interface IDependencyOptions
4040
/// </summary>
4141
bool ScanNetFrameworkDlls { get; }
4242

43-
/// <summary>
44-
/// Whether to use mscorlib as a reference.
45-
/// </summary>
46-
bool UseMscorlib { get; }
47-
4843
/// <summary>
4944
/// Determine whether the given path should be excluded.
5045
/// </summary>
@@ -74,8 +69,6 @@ public class DependencyOptions : IDependencyOptions
7469

7570
public bool ScanNetFrameworkDlls { get; set; } = true;
7671

77-
public bool UseMscorlib { get; set; } = true;
78-
7972
public bool ExcludesFile(string path) =>
8073
Excludes.Any(path.Contains);
8174

csharp/extractor/Semmle.Extraction.CSharp.Standalone/Options.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public override bool HandleFlag(string key, bool value)
2929
case "all-references":
3030
AnalyseCsProjFiles = !value;
3131
return true;
32-
case "stdlib":
33-
dependencies.UseMscorlib = value;
34-
return true;
3532
case "skip-dotnet":
3633
dependencies.ScanNetFrameworkDlls = !value;
3734
return true;
@@ -110,7 +107,7 @@ public override void InvalidArgument(string argument)
110107
/// <summary>
111108
/// Outputs the command line options to the console.
112109
/// </summary>
113-
public static void ShowHelp(System.IO.TextWriter output)
110+
public static void ShowHelp(TextWriter output)
114111
{
115112
output.WriteLine("C# standalone extractor\n\nExtracts a C# project in the current directory without performing a build.\n");
116113
output.WriteLine("Additional options:\n");
@@ -121,7 +118,6 @@ public static void ShowHelp(System.IO.TextWriter output)
121118
output.WriteLine(" --dry-run Stop before extraction");
122119
output.WriteLine(" --skip-nuget Do not download nuget packages");
123120
output.WriteLine(" --all-references Use all references (default is to only use references in .csproj files)");
124-
output.WriteLine(" --nostdlib Do not link mscorlib.dll (use only for extracting mscorlib itself)");
125121
output.WriteLine(" --threads:nnn Specify number of threads (default=CPU cores)");
126122
output.WriteLine(" --verbose Produce more output");
127123
output.WriteLine(" --pdb Cross-reference information from PDBs where available");

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,8 @@ public void Framework()
135135
public void StandaloneDefaults()
136136
{
137137
standaloneOptions = CSharp.Standalone.Options.Create(Array.Empty<string>());
138-
Assert.Equal(0, standaloneOptions.Dependencies.DllDirs.Count);
138+
Assert.Empty(standaloneOptions.Dependencies.DllDirs);
139139
Assert.True(standaloneOptions.Dependencies.UseNuGet);
140-
Assert.True(standaloneOptions.Dependencies.UseMscorlib);
141140
Assert.False(standaloneOptions.SkipExtraction);
142141
Assert.Null(standaloneOptions.Dependencies.SolutionFile);
143142
Assert.True(standaloneOptions.Dependencies.ScanNetFrameworkDlls);
@@ -147,12 +146,11 @@ public void StandaloneDefaults()
147146
[Fact]
148147
public void StandaloneOptions()
149148
{
150-
standaloneOptions = CSharp.Standalone.Options.Create(new string[] { "--references:foo", "--silent", "--skip-nuget", "--skip-dotnet", "--exclude", "bar", "--nostdlib" });
149+
standaloneOptions = CSharp.Standalone.Options.Create(new string[] { "--references:foo", "--silent", "--skip-nuget", "--skip-dotnet", "--exclude", "bar" });
151150
Assert.Equal("foo", standaloneOptions.Dependencies.DllDirs[0]);
152151
Assert.Equal("bar", standaloneOptions.Dependencies.Excludes[0]);
153152
Assert.Equal(Verbosity.Off, standaloneOptions.Verbosity);
154153
Assert.False(standaloneOptions.Dependencies.UseNuGet);
155-
Assert.False(standaloneOptions.Dependencies.UseMscorlib);
156154
Assert.False(standaloneOptions.Dependencies.ScanNetFrameworkDlls);
157155
Assert.False(standaloneOptions.Errors);
158156
Assert.False(standaloneOptions.Help);

0 commit comments

Comments
 (0)