Skip to content

Commit

Permalink
Updating StructuredLogger to fix type duplication problems
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Aug 18, 2021
1 parent a219748 commit e30d447
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
2 changes: 2 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 3.2.4

- Updated structured logging library to consolidate MSBuild and binary logging types (internal change, should be no impact to consumers).

# 3.2.3

- Fixed a bug where Buildalyzer.Workspaces would not add transitive references to projects in the Roslyn workspace (#181).
Expand Down
6 changes: 2 additions & 4 deletions src/Buildalyzer/AnalyzerManager.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
extern alias StructuredLogger;

using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Buildalyzer.Logging;
using Microsoft.Build.Construction;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Extensions.Logging;
using StructuredLogger::Microsoft.Build.Logging.StructuredLogger;

namespace Buildalyzer
{
Expand Down
2 changes: 1 addition & 1 deletion src/Buildalyzer/Buildalyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.507" Aliases="StructuredLogger" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.545" />
<PackageReference Include="MsBuildPipeLogger.Server" Version="1.1.3" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.6.0" />
</ItemGroup>
Expand Down
12 changes: 0 additions & 12 deletions src/Buildalyzer/Logging/EventProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern alias StructuredLogger;

using System;
using System.Collections;
using System.Collections.Generic;
Expand Down Expand Up @@ -67,8 +65,6 @@ public EventProcessor(AnalyzerManager manager, ProjectAnalyzer analyzer, IEnumer
// See https://twitter.com/KirillOsenkov/status/1427686459713019904
private void StatusEventRaised(object sender, BuildStatusEventArgs e)
{
// Needed to add an extern alias, see https://github.com/KirillOsenkov/MSBuildStructuredLog/issues/521
// Also need to account for either type coming from either a StructuredLogging reader or MSBuild
if (e is ProjectEvaluationFinishedEventArgs msBuildEv)
{
_evalulationResults[msBuildEv.BuildEventContext.EvaluationId] = new PropertiesAndItems
Expand All @@ -77,14 +73,6 @@ private void StatusEventRaised(object sender, BuildStatusEventArgs e)
Items = msBuildEv.Items
};
}
else if (e is StructuredLogger::Microsoft.Build.Framework.ProjectEvaluationFinishedEventArgs slEv)
{
_evalulationResults[slEv.BuildEventContext.EvaluationId] = new PropertiesAndItems
{
Properties = slEv.Properties,
Items = slEv.Items
};
}
}

private void ProjectStarted(object sender, ProjectStartedEventArgs e)
Expand Down

0 comments on commit e30d447

Please sign in to comment.