|
1 |
| -using System; |
2 | 1 | using System.Collections;
|
3 |
| -using System.Collections.Generic; |
4 | 2 | using System.IO;
|
5 |
| -using System.Linq; |
6 |
| -using System.Text; |
7 | 3 | using Buildalyzer.Construction;
|
8 | 4 | using Buildalyzer.Logging;
|
9 | 5 | using Microsoft.Build.Framework;
|
@@ -31,6 +27,8 @@ public class AnalyzerResult : IAnalyzerResult
|
31 | 27 | private string[] _compilerArguments;
|
32 | 28 | private string _compilerFilePath;
|
33 | 29 |
|
| 30 | + public CompilerCommand CompilerCommand { get; private set; } |
| 31 | + |
34 | 32 | internal AnalyzerResult(string projectFilePath, AnalyzerManager manager, ProjectAnalyzer analyzer)
|
35 | 33 | {
|
36 | 34 | ProjectFilePath = projectFilePath;
|
@@ -64,7 +62,7 @@ internal AnalyzerResult(string projectFilePath, AnalyzerManager manager, Project
|
64 | 62 | public Guid ProjectGuid => _projectGuid;
|
65 | 63 |
|
66 | 64 | /// <inheritdoc/>
|
67 |
| - public string Command => _command; |
| 65 | + public string Command => CompilerCommand?.Text ?? _command; |
68 | 66 |
|
69 | 67 | /// <inheritdoc/>
|
70 | 68 | public string CompilerFilePath => _compilerFilePath;
|
@@ -121,6 +119,7 @@ public string GetProperty(string name) =>
|
121 | 119 | .ToArray() ?? Array.Empty<string>();
|
122 | 120 |
|
123 | 121 | public string[] PreprocessorSymbols =>
|
| 122 | + CompilerCommand?.PreprocessorSymbolNames.ToArray() ?? |
124 | 123 | _cscCommandLineArguments
|
125 | 124 | ?.Where(x => x.Item1 is object && x.Item1.Equals("define", StringComparison.OrdinalIgnoreCase))
|
126 | 125 | .SelectMany(x => x.Item2.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
|
@@ -182,6 +181,7 @@ internal void ProcessCscCommandLine(string commandLine, bool coreCompile)
|
182 | 181 | return;
|
183 | 182 | }
|
184 | 183 | ProcessedCommandLine cmd = ProcessCscCommandLine(commandLine);
|
| 184 | + CompilerCommand = Compiler.CommandLine.Parse(commandLine, CompilerLanguage.CSharp); |
185 | 185 | _command = cmd.Command;
|
186 | 186 | _compilerFilePath = cmd.FileName;
|
187 | 187 | _compilerArguments = cmd.Arguments.ToArray();
|
@@ -269,6 +269,7 @@ internal void ProcessVbcCommandLine(string commandLine)
|
269 | 269 | }
|
270 | 270 | }
|
271 | 271 |
|
| 272 | + CompilerCommand = Compiler.CommandLine.Parse(commandLine, CompilerLanguage.VisualBasic); |
272 | 273 | _command = cmd.Command;
|
273 | 274 | _compilerFilePath = cmd.FileName;
|
274 | 275 | _compilerArguments = cmd.Arguments.ToArray();
|
|
0 commit comments