|
4 | 4 |
|
5 | 5 | namespace Buildalyzer; |
6 | 6 |
|
| 7 | +[DebuggerDisplay("{DebuggerDisplay}")] |
7 | 8 | public class AnalyzerResult : IAnalyzerResult |
8 | 9 | { |
9 | 10 | private readonly Dictionary<string, string> _properties = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); |
@@ -91,6 +92,41 @@ public string GetProperty(string name) => |
91 | 92 | ? items.Distinct(new ProjectItemItemSpecEqualityComparer()).ToDictionary(x => x.ItemSpec, x => x.Metadata) |
92 | 93 | : []; |
93 | 94 |
|
| 95 | + [DebuggerBrowsable(DebuggerBrowsableState.Never)] |
| 96 | + private string DebuggerDisplay |
| 97 | + { |
| 98 | + get |
| 99 | + { |
| 100 | + var sb = new StringBuilder(); |
| 101 | + |
| 102 | + sb |
| 103 | + .Append(Path.GetFileName(ProjectFilePath)) |
| 104 | + .Append($", TFM = {TargetFramework}") |
| 105 | + .Append($", Properties = {Properties.Count}") |
| 106 | + .Append($", Items = {Items.Count}") |
| 107 | + .Append($", Source Files = {SourceFiles.Length}"); |
| 108 | + |
| 109 | + if (!Succeeded) |
| 110 | + { |
| 111 | + sb.Append(", Succeeded = false"); |
| 112 | + } |
| 113 | + |
| 114 | + if (ProjectReferences.Any()) |
| 115 | + { |
| 116 | + sb.Append($", Project References = {ProjectReferences.Count()}"); |
| 117 | + } |
| 118 | + if (AdditionalFiles is { Length: > 0 } af) |
| 119 | + { |
| 120 | + sb.Append($", Additional Files = {af.Length}"); |
| 121 | + } |
| 122 | + if (PackageReferences is { Count: > 0 } pr) |
| 123 | + { |
| 124 | + sb.Append($", Package References = {pr.Count}"); |
| 125 | + } |
| 126 | + return sb.ToString(); |
| 127 | + } |
| 128 | + } |
| 129 | + |
94 | 130 | internal void ProcessProject(PropertiesAndItems propertiesAndItems) |
95 | 131 | { |
96 | 132 | // Add properties |
|
0 commit comments