Skip to content

Commit

Permalink
Add async serializer initialization for perf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ccastanedaucf committed Oct 20, 2018
1 parent 4ecc505 commit e2e670b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Build/BackEnd/BuildManager/BuildManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Microsoft.Build.Internal;
using Microsoft.Build.Logging;
using Microsoft.Build.Shared;
using Microsoft.Build.Tasks;
using ForwardingLoggerRecord = Microsoft.Build.Logging.ForwardingLoggerRecord;
using LoggerDescription = Microsoft.Build.Logging.LoggerDescription;

Expand Down Expand Up @@ -344,6 +345,8 @@ public static BuildManager DefaultBuildManager
/// <exception cref="InvalidOperationException">Thrown if a build is already in progress.</exception>
public void BeginBuild(BuildParameters parameters)
{
System.Threading.Tasks.Task.Run(() => { ResolveAssemblyReference.InitializeSerializers(); });

lock (_syncLock)
{
// Check for build in progress.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
using Microsoft.Build.Internal;

using BackendNativeMethods = Microsoft.Build.BackEnd.NativeMethods;
using System.Threading.Tasks;
using Task = System.Threading.Tasks.Task;
using Microsoft.Build.Shared.FileSystem;
using Microsoft.Build.Utilities;
using DotNetFrameworkArchitecture = Microsoft.Build.Shared.DotNetFrameworkArchitecture;

namespace Microsoft.Build.BackEnd
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
using ReservedPropertyNames = Microsoft.Build.Internal.ReservedPropertyNames;
using NodeLoggingContext = Microsoft.Build.BackEnd.Logging.NodeLoggingContext;
using ProjectLoggingContext = Microsoft.Build.BackEnd.Logging.ProjectLoggingContext;
using Task = System.Threading.Tasks.Task;

namespace Microsoft.Build.BackEnd
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Task = System.Threading.Tasks.Task;

namespace Microsoft.Build.BackEnd.SdkResolution
{
Expand Down
1 change: 1 addition & 0 deletions src/Build/Microsoft.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

<ItemGroup>
<ProjectReference Include="..\Framework\Microsoft.Build.Framework.csproj" />
<ProjectReference Include="..\Tasks\Microsoft.Build.Tasks.csproj" />

<PackageReference Include="System.Collections.Immutable" />
<PackageReference Include="System.IO.Compression" />
Expand Down

0 comments on commit e2e670b

Please sign in to comment.