Skip to content

Commit

Permalink
(build) Don't build NuGet packages on POSIX
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gep13 committed Oct 20, 2022
1 parent 7d12613 commit 348f0be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 348f0be

Please # to comment.