From f6b0196b0f8a7342d4b5fe5709568af9e3ede665 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Wed, 25 Jan 2017 23:03:08 -0600 Subject: [PATCH] Turn off multi-proc building of the test .sln to work around "cannot access file becuase it is being used by another process" errors. --- build/Microsoft.DotNet.Cli.Test.targets | 1 + build_projects/dotnet-cli-build/DotNetBuild.cs | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/build/Microsoft.DotNet.Cli.Test.targets b/build/Microsoft.DotNet.Cli.Test.targets index b968033cc..0941fa6c9 100644 --- a/build/Microsoft.DotNet.Cli.Test.targets +++ b/build/Microsoft.DotNet.Cli.Test.targets @@ -81,6 +81,7 @@ diff --git a/build_projects/dotnet-cli-build/DotNetBuild.cs b/build_projects/dotnet-cli-build/DotNetBuild.cs index fbe0dcae4..f11ec52f4 100644 --- a/build_projects/dotnet-cli-build/DotNetBuild.cs +++ b/build_projects/dotnet-cli-build/DotNetBuild.cs @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli.Build protected override string Args { - get { return $"{GetProjectPath()} {GetConfiguration()} {GetFramework()} {GetRuntime()} {GetOutputPath()}"; } + get { return $"{GetProjectPath()} {GetConfiguration()} {GetFramework()} {GetRuntime()} {GetOutputPath()} {GetMaxCpuCount()}"; } } public string BuildBasePath { get; set; } @@ -26,7 +26,9 @@ namespace Microsoft.DotNet.Cli.Build public string ProjectPath { get; set; } public string OutputPath { get; set; } - + + public string MaxCpuCount { get; set; } + private string GetOutputPath() { if (!string.IsNullOrEmpty(OutputPath)) @@ -76,5 +78,15 @@ namespace Microsoft.DotNet.Cli.Build return null; } + + private string GetMaxCpuCount() + { + if (!string.IsNullOrEmpty(MaxCpuCount)) + { + return $"/maxcpucount:{MaxCpuCount}"; + } + + return null; + } } }