Skip to content

Commit afd6f58

Browse files
authored
Merge pull request github#7741 from hvitved/csharp/compilation-args-exclude-extractor-args
C#: Exclude extractor arguments from `compilation_args` relation
2 parents 63ff17b + d7a91fd commit afd6f58

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ public static ExitCode Run(string[] args)
8686
var stopwatch = new Stopwatch();
8787
stopwatch.Start();
8888

89-
Entities.Compilation.Settings = (Directory.GetCurrentDirectory(), args);
89+
var options = Options.CreateWithEnvironment(args);
90+
Entities.Compilation.Settings = (Directory.GetCurrentDirectory(), options.CompilerArguments.ToArray());
9091

91-
var options = Options.CreateWithEnvironment(Entities.Compilation.Settings.Args);
9292
var fileLogger = new FileLogger(options.Verbosity, GetCSharpLogPath());
9393
using var logger = options.Console
9494
? new CombinedLogger(new ConsoleLogger(options.Verbosity), fileLogger)

csharp/ql/test/library-tests/compilations/Compilations.expected

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ compilationArguments
1313
| compilation | 5 | /r:System.Core.dll |
1414
| compilation | 6 | /r:System.Runtime.dll |
1515
| compilation | 7 | /r:System.Console.dll |
16-
| compilation | 8 | --console |
17-
| compilation | 9 | --verbosity |
18-
| compilation | 10 | 2 |
19-
| compilation | 11 | Program.cs |
16+
| compilation | 8 | Program.cs |
2017
compilationFiles
2118
| compilation | 0 | Program.cs:0:0:0:0 | Program.cs |
2219
compilationFolder

0 commit comments

Comments
 (0)