NUnit.Cake.Recipe 1.5.0

Prefix Reserved
dotnet add package NUnit.Cake.Recipe --version 1.5.0
                    
NuGet\Install-Package NUnit.Cake.Recipe -Version 1.5.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NUnit.Cake.Recipe" Version="1.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NUnit.Cake.Recipe" Version="1.5.0" />
                    
Directory.Packages.props
<PackageReference Include="NUnit.Cake.Recipe" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NUnit.Cake.Recipe --version 1.5.0
                    
#r "nuget: NUnit.Cake.Recipe, 1.5.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NUnit.Cake.Recipe@1.5.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NUnit.Cake.Recipe&version=1.5.0
                    
Install as a Cake Addin
#tool nuget:?package=NUnit.Cake.Recipe&version=1.5.0
                    
Install as a Cake Tool

NUnit.Cake.Recipe

NUnit.Cake.Recipe is a standard cake recipe used for NUnit projects. It is inspired by Cake.Recipe, but is somewhat simpler in implementation, since it isn't intended for general use.

Structure of the build.cake File

The following is an example of a simple build.cake file for a project which uses the recipe to create a single package.

// Load the recipe
#load nuget:?package=NUnit.Cake.Recipe&version=1.4.0 // Note 1

// Initialize Build Settings
BuildSettings.Initialize(                            // Note 2
	context: Context,
	title: "Sample Application",
	githubRepository: "NUnit.Sample.Application");

// Define the package
BuildSettings.Packages.Add(new NuGetPackage(         // Note 3
	id: "NUnit.Sample.Application",
	source: "nuget/NUnit.Sample.Application.nuspec",
	checks: new PackageCheck[] {
		HasFiles(
			"LICENSE.txt", "README.md", "nunit.png",
			"lib/net8.0/nunit.sample.application.dll") }));

// Run the task selected by user or default task
Build.Run();                                         // Note 4

NOTES:

  1. The #load statement loads NUnit.Cake.Recipe, specifying the version to use, in this case version 1.4.0. You should always specify the recipe version to avoid unpleasant surprises when the recipe is updated.

  2. BuildSettings.Initialize sets the parameters which drive the build process. The example specifies only the three required arguments.

  3. Define a single nuget package.

  4. Run the selected target. This must be the last command in the file.

Supported Arguments

The recipe supports a number of standard command-line arguments. Additional arguments may be supported directly by the user's build.cake file, but must not conflict with the built-in arguments.

--target, -t=TARGET

The name of the TARGET task to be run, e.g. Test. Default is "Build." For a list of supported targets, use the Cake --description option.

--configuration, -c=CONFIG

The name of the configuration to build, test and/or package, e.g. Debug. Defaults to Release.

--packageVersion=VERSION

Specifies the full package version, including any pre-release suffix. This version is used directly instead of the default version from the script or that calculated by GitVersion. Note that all other versions (AssemblyVersion, etc.) are derived from the package version.

NOTE: We can't use "version" since that's an argument to Cake itself.

--packageId, --id=ID

Specifies the id of a package for which packaging is to be performed. If not specified, all ids are processed.

--packageType, --type=TYPE

Specifies the type package for which packaging is to be performed. Valid values for TYPE are 'nuget', 'choco' and 'zip'. If not specified, all types are processed.

--level, --lev=LEVEL

Specifies the level of package testing, which is normally set automatically for different types of builds like CI, PR, etc. Used by developers to test packages locally without creating a PR or publishing the package. Defined levels are

  1. Normal CI tests run every time you build a package
  2. Adds more tests for PRs and Dev builds uploaded to MyGet
  3. Adds even more tests prior to publishing a release
--trace, --tr=LEVEL

Specifies the default trace level for this run. Values are Off, Error, Warning, Info or Debug. Default is Off.

--nobuild, --nob

Indicates that the Build task should not be run even if other tasks depend on it. The existing build is used instead.

--nopush, --nop

Indicates that no publishing or releasing should be done. If publish or release targets are run, a message is displayed.

--usage

Displays a general help message. No targets are run.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.0 367 6/14/2025
1.4.0 320 4/19/2025
1.3.0 360 12/27/2024
1.2.1 313 11/2/2024
1.2.0 303 10/8/2024
1.1.0 310 8/12/2024