From ba69c88c79230c711c1ca6383f79649d2af320e4 Mon Sep 17 00:00:00 2001 From: Piotr Puszkiewicz Date: Fri, 27 Jan 2017 17:13:04 -0800 Subject: [PATCH] Work around `build test.sln` race condition until fixed (#5490) * Remove GenerateRuntimeConfigurationFiles from this library * Disable parallel build of test.sln * PR feedback --- build/Microsoft.DotNet.Cli.Test.targets | 3 +- .../dotnet-cli-build/DotNetBuild.cs | 4 +- .../dotnet-cli-build/DotNetMSBuild.cs | 4 +- .../dotnet-cli-build/DotNetMSBuildTool.cs | 32 ++++++++++++++ build_projects/dotnet-cli-build/DotNetPack.cs | 4 +- .../dotnet-cli-build/DotNetPublish.cs | 4 +- .../dotnet-cli-build/DotNetRestore.cs | 4 +- build_projects/dotnet-cli-build/DotNetTest.cs | 4 +- .../Msbuild.Tests.Utilities.csproj | 44 +++++-------------- 9 files changed, 58 insertions(+), 45 deletions(-) create mode 100644 build_projects/dotnet-cli-build/DotNetMSBuildTool.cs diff --git a/build/Microsoft.DotNet.Cli.Test.targets b/build/Microsoft.DotNet.Cli.Test.targets index fcbd1a668..2b85daa3e 100644 --- a/build/Microsoft.DotNet.Cli.Test.targets +++ b/build/Microsoft.DotNet.Cli.Test.targets @@ -82,7 +82,8 @@ + ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln"" + MaxCpuCount="1" /> 0) + { + return $"/m:{MaxCpuCount}"; + } + + return null; + } + } +} diff --git a/build_projects/dotnet-cli-build/DotNetPack.cs b/build_projects/dotnet-cli-build/DotNetPack.cs index 96bcbc884..bf4bef93d 100644 --- a/build_projects/dotnet-cli-build/DotNetPack.cs +++ b/build_projects/dotnet-cli-build/DotNetPack.cs @@ -3,7 +3,7 @@ namespace Microsoft.DotNet.Cli.Build { - public class DotNetPack : DotNetTool + public class DotNetPack : DotNetMSBuildTool { protected override string Command { @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli.Build 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; } diff --git a/build_projects/dotnet-cli-build/DotNetPublish.cs b/build_projects/dotnet-cli-build/DotNetPublish.cs index 8fbb88cbc..f4c2aec24 100644 --- a/build_projects/dotnet-cli-build/DotNetPublish.cs +++ b/build_projects/dotnet-cli-build/DotNetPublish.cs @@ -3,7 +3,7 @@ namespace Microsoft.DotNet.Cli.Build { - public class DotNetPublish : DotNetTool + public class DotNetPublish : DotNetMSBuildTool { protected override string Command { @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli.Build 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; } diff --git a/build_projects/dotnet-cli-build/DotNetRestore.cs b/build_projects/dotnet-cli-build/DotNetRestore.cs index d3f1a2b4d..88bca5e22 100644 --- a/build_projects/dotnet-cli-build/DotNetRestore.cs +++ b/build_projects/dotnet-cli-build/DotNetRestore.cs @@ -3,7 +3,7 @@ namespace Microsoft.DotNet.Cli.Build { - public class DotNetRestore : DotNetTool + public class DotNetRestore : DotNetMSBuildTool { protected override string Command { @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli.Build 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; } diff --git a/build_projects/dotnet-cli-build/DotNetTest.cs b/build_projects/dotnet-cli-build/DotNetTest.cs index fd10ed7ea..6ed55055c 100644 --- a/build_projects/dotnet-cli-build/DotNetTest.cs +++ b/build_projects/dotnet-cli-build/DotNetTest.cs @@ -3,7 +3,7 @@ namespace Microsoft.DotNet.Cli.Build { - public class DotNetTest : DotNetTool + public class DotNetTest : DotNetMSBuildTool { protected override string Command { @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli.Build protected override string Args { - get { return $"{GetProjectPath()} {GetConfiguration()} {GetLogger()} {GetNoBuild()}"; } + get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetLogger()} {GetNoBuild()}"; } } public string Configuration { get; set; } diff --git a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj index 91dbcc61a..7d17cd6c5 100644 --- a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj +++ b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj @@ -1,49 +1,29 @@ - + netcoreapp1.1 - true Msbuild.Tests.Utilities $(PackageTargetFallback);dotnet5.4;portable-net451+win8 - - true - + - - true - - - true - + + + - - true - + + - - 1.6.0 - - - 4.3.0 - - - 4.18.0 - - - 2.2.0-beta4-build3444 - - - $(CLI_MSBuild_Version) - + + + + + - - $(DefineConstants);RELEASE -