From 348f0be37dc157bdf861158f08ccd736c1bc929a Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Thu, 20 Oct 2022 16:05:39 +0100 Subject: [PATCH] (build) Don't build NuGet packages on POSIX In order to create a "working" NuGet package, we need to ILMerge assemblies into the choco.exe and chocolatey.dll files. This is currently only possible when running on Windows. As such, ensure to set the shouldRunNuGet parameter to false when not running on Windows. This setting could have been made globally within Chocolatey.Cake.Recipe, however, this would have prevented some projects needing to make the change in the other direction, and this was seen as the lesser of the two. --- recipe.cake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipe.cake b/recipe.cake index c192390fb4..3168f6ef3f 100644 --- a/recipe.cake +++ b/recipe.cake @@ -133,6 +133,7 @@ Task("Prepare-Chocolatey-Packages") }); Task("Prepare-NuGet-Packages") + .WithCriteria(() => BuildParameters.ShouldRunNuGet, "Skipping because execution of NuGet has been disabled") .IsDependeeOf("Create-NuGet-Packages") .IsDependeeOf("Sign-PowerShellScripts") .IsDependeeOf("Sign-Assemblies") @@ -169,7 +170,8 @@ BuildParameters.SetParameters(context: Context, getScriptsToSign: getScriptsToSign, getFilesToSign: getFilesToSign, getILMergeConfigs: getILMergeConfigs, - preferDotNetGlobalToolUsage: !IsRunningOnWindows()); + preferDotNetGlobalToolUsage: !IsRunningOnWindows(), + shouldRunNuGet: IsRunningOnWindows()); ToolSettings.SetToolSettings(context: Context, buildMSBuildToolVersion: MSBuildToolVersion.NET40);