TestCentric.Cake.Recipe is a standard cake recipe used for TestCentric projects. It is inspired by Cake.Recipe but is somewhat simpler in implementation, since it isn't intended for general use. The recipe is still under development.
build.cake
FileThe following is an example of a simple build.cake
file for a project which creates a single package.
// Load the recipe
#load nuget:?package=TestCentric.Cake.Recipe&version=1.1.0
// Initialize Build Settings
BuildSettings.Initialize(
context: Context,
title: "Sample Application",
githubRepository: "TestCentric.Sample.Application");
// Define the package
BuildSettings.Packages.Add(new NuGetPackage(
id: "TestCentric.Sample.Application",
source: "nuget/TestCentric.Sample.Application.nuspec",
checks: new PackageCheck[] {
HasFiles(
"LICENSE.txt", "README.md", "testcentric.png",
"lib/net8.0/testcentric.sample.application.dll") }));
// Run the task selected by user or default task
Build.Run();
NOTES:
The #load
statement loads TestCentric.Cake.Recipe
, specifying the version to use,
in this case version 1.1.0. It is generally recommended that you specify the recipe
version to avoid unpleasant surprises when the recipe is updated.
BuildSettings.Initialize
sets the parameters which drive the build process. The example
specifies only the three required paraameters. See below for a complete list of parameters.
Define a single nuget
package.
Run the selected target. This must be the last command in the file.
The recipe supports a number of standard arguments for use in any project
that uses it. Additional arguments may be supported directly by the user's
build.cake
if necessary but must not conflict with the built-in arguments.
Arguments taking a value may use =
or space to separate the name
from the value.
The name of the TARGET task to be run, e.g. Test. Default is "Build."
The name of the configuration to build, test and/or package, e.g. Debug. Defaults to Release.
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.
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
Specifies the default trace level for this run. Values are Off, Error, Warning, Info or Debug. Default is value of environment variable TESTCENTRIC_INTERNAL_TRACE_LEVEL if set. If not, tracing is turned Off.
Indicates that the Build task should not be run even if other tasks depend on it. The existing build is used instead.
Indicates that no publishing or releasing should be done. If publish or release targets are run, a message is displayed.
Displays this help message. No targets are run.