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

Commit

Permalink
Disable parallel build of test.sln
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Puszkiewicz committed Jan 27, 2017
1 parent 4d4d7c4 commit 540c2b0
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 13 deletions.
3 changes: 2 additions & 1 deletion build/Microsoft.DotNet.Cli.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
<Target Name="BuildTests"
DependsOnTargets="RestoreTests;">
<DotNetBuild ToolPath="$(Stage0Directory)"
ProjectPath="&quot;$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln&quot;" />
ProjectPath="&quot;$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln&quot;"
MaxCpuCount="1" />
</Target>

<Target Name="CreateTestAssetPackageNuPkgs"
Expand Down
4 changes: 2 additions & 2 deletions build_projects/dotnet-cli-build/DotNetBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.DotNet.Cli.Build
{
public class DotNetBuild : DotNetTool
public class DotNetBuild : DotNetMSBuildTool
{
protected override string Command
{
Expand All @@ -12,7 +12,7 @@ protected override string Command

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

public string BuildBasePath { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions build_projects/dotnet-cli-build/DotNetMSBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.DotNet.Cli.Build
{
public class DotNetMSBuild : DotNetTool
public class DotNetMSBuild : DotNetMSBuildTool
{
protected override string Command
{
Expand All @@ -12,7 +12,7 @@ protected override string Command

protected override string Args
{
get { return $"{GetArguments()}"; }
get { return $"{base.Args} {GetArguments()}"; }
}

public string Arguments { get; set; }
Expand Down
36 changes: 36 additions & 0 deletions build_projects/dotnet-cli-build/DotNetMSBuildTool.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

using Microsoft.DotNet.Cli.Build.Framework;

namespace Microsoft.DotNet.Cli.Build
{
public abstract class DotNetMSBuildTool : DotNetTool
{
public DotNetMSBuildTool()
{
}

public int MaxCpuCount {get; set;} = 0;

protected override string Args
{
get
{
return $"{GetMaxCpuCountArg()}";
}
}

private string GetMaxCpuCountArg()
{
if (MaxCpuCount > 0)
{
return $"/m:{MaxCpuCount}";
}

return null;
}
}
}
4 changes: 2 additions & 2 deletions build_projects/dotnet-cli-build/DotNetPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.DotNet.Cli.Build
{
public class DotNetPack : DotNetTool
public class DotNetPack : DotNetMSBuildTool
{
protected override string Command
{
Expand All @@ -12,7 +12,7 @@ protected override string Command

protected override string Args
{
get { return $"{GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetOutput()} {GetVersionSuffix()} {GetRuntime()} {MsbuildArgs}"; }
get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetOutput()} {GetVersionSuffix()} {GetRuntime()} {MsbuildArgs}"; }
}

public string Configuration { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions build_projects/dotnet-cli-build/DotNetPublish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.DotNet.Cli.Build
{
public class DotNetPublish : DotNetTool
public class DotNetPublish : DotNetMSBuildTool
{
protected override string Command
{
Expand All @@ -12,7 +12,7 @@ protected override string Command

protected override string Args
{
get { return $"{GetProjectPath()} {GetConfiguration()} {GetFramework()} {GetNativeSubdirectory()} {GetBuildBasePath()} {GetOutput()} {GetVersionSuffix()} {GetRuntime()} {GetMSBuildArgs()}"; }
get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetFramework()} {GetNativeSubdirectory()} {GetBuildBasePath()} {GetOutput()} {GetVersionSuffix()} {GetRuntime()} {GetMSBuildArgs()}"; }
}

public string BuildBasePath { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions build_projects/dotnet-cli-build/DotNetRestore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.DotNet.Cli.Build
{
public class DotNetRestore : DotNetTool
public class DotNetRestore : DotNetMSBuildTool
{
protected override string Command
{
Expand All @@ -12,7 +12,7 @@ protected override string Command

protected override string Args
{
get { return $"{GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {GetAdditionalParameters()}"; }
get { return $"{base.Args} {GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {GetAdditionalParameters()}"; }
}

public string ConfigFile { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions build_projects/dotnet-cli-build/DotNetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.DotNet.Cli.Build
{
public class DotNetTest : DotNetTool
public class DotNetTest : DotNetMSBuildTool
{
protected override string Command
{
Expand All @@ -12,7 +12,7 @@ protected override string Command

protected override string Args
{
get { return $"{GetProjectPath()} {GetConfiguration()} {GetLogger()} {GetNoBuild()}"; }
get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetLogger()} {GetNoBuild()}"; }
}

public string Configuration { get; set; }
Expand Down

0 comments on commit 540c2b0

Please sign in to comment.