Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Turn off multi-proc building of the test .sln to work around "cannot …
Browse files Browse the repository at this point in the history
…access file becuase it is being used by another process" errors.
  • Loading branch information
eerhardt committed Jan 26, 2017
1 parent d415381 commit f6b0196
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions build/Microsoft.DotNet.Cli.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
<Target Name="BuildTests"
DependsOnTargets="RestoreTests;">
<DotNetBuild ToolPath="$(Stage0Directory)"
MaxCpuCount="1"
ProjectPath="&quot;$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln&quot;" />
</Target>

Expand Down
16 changes: 14 additions & 2 deletions build_projects/dotnet-cli-build/DotNetBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ protected override string Command

protected override string Args
{
get { return $"{GetProjectPath()} {GetConfiguration()} {GetFramework()} {GetRuntime()} {GetOutputPath()}"; }
get { return $"{GetProjectPath()} {GetConfiguration()} {GetFramework()} {GetRuntime()} {GetOutputPath()} {GetMaxCpuCount()}"; }
}

public string BuildBasePath { get; set; }
Expand All @@ -26,7 +26,9 @@ protected override string Args
public string ProjectPath { get; set; }

public string OutputPath { get; set; }


public string MaxCpuCount { get; set; }

private string GetOutputPath()
{
if (!string.IsNullOrEmpty(OutputPath))
Expand Down Expand Up @@ -76,5 +78,15 @@ private string GetProjectPath()

return null;
}

private string GetMaxCpuCount()
{
if (!string.IsNullOrEmpty(MaxCpuCount))
{
return $"/maxcpucount:{MaxCpuCount}";
}

return null;
}
}
}

0 comments on commit f6b0196

Please sign in to comment.