Pulsewave.Box.Recipe 1.0.1-beta.20230323212346

This is a prerelease version of Pulsewave.Box.Recipe.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Pulsewave.Box.Recipe --version 1.0.1-beta.20230323212346                
NuGet\Install-Package Pulsewave.Box.Recipe -Version 1.0.1-beta.20230323212346                
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="Pulsewave.Box.Recipe" Version="1.0.1-beta.20230323212346" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pulsewave.Box.Recipe --version 1.0.1-beta.20230323212346                
#r "nuget: Pulsewave.Box.Recipe, 1.0.1-beta.20230323212346"                
#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.
#load nuget:?package=Pulsewave.Box.Recipe&version=1.0.1-beta.20230323212346&prerelease                

Pulsewave.Box.Recipe

main-build develop-build nuget

Re-usable cake scripts to build, test, deploy, codeql, dependenbot, mutation testing, release for any projects.

Table of content

Documentation

Entry point

You should add a entry point to run all cake commands. This project and all box nugets follow a standard but it is not necessary to follow this standard for your own project.

  • the entry point file should be named as main.cake
  • Should load Pulsewave.Box.Recipe nuget with latest version
  • Should setup the project information
  • Should have RunTarget(Argument<string>("run")); at the end of the file

Here an example

#load nuget:?package=Pulsewave.Box.Recipe&version=1.0.0

// Setup the main with a project.
Setup(context =>
{
    // The project on which the tasks are based
    Project project = new(context, new ProjectSettings
    {
        ProjectPath = "./src/Pulsewave.Box.Recipe/Pulsewave.Box.Recipe.csproj"
    });

    // Display additional information like the cake version and the project.
    Information($"Using Cake with the version: {context.GetVersion()}\n");
    Information(project);

    return project;
});

// You can add any task that you need like cleanup the folders, send an email, etc...

// The runner to run any command.
RunTarget(Argument<string>("run"));

Commands

  • [command] is required to run a cake task.
  • --[options] is a optional key/value pair.

dotnet cake main.cake --run [command] --[options]

command description Dependency
restore Execute dotnet restore for the current project. none
build Execute dotnet build for the current project. restore
test Execute dotnet test for all test projects. build
pack Execute dotnet pack for the current project. none
push Execute dotnet nuget push for the current project. none

options

options description default
configuration Set the configuration (Release, Debug) for the project. Release
output Set the output directory when executing pack command. None
code-coverage Generate a code coverage report. false
all Override ProjectPath with Paths. false
beta Create a beta version for the project. beta.yyyyMMddHHmmss
api-token Set the NuGet api token when executing push command. None
skip-duplicate Skip duplicated NuGet when executing push command. true
nuget The NuGet folder to push the file when executing push command. none
source Set the NuGet source (dev, prod) when executing push command. none
validate Validate the nupkg file if follow the nuget standard. none
  • dev NuGet source push to nugettest.org which is a testing environment for nugets.
  • prod NuGet source push to nuget.org.

Project

Represent a project with predefined configurations.

Constructor

Initializes a new instance of the Project

  • context: The context.
  • settings: the project settings.

Project(ISetupContext context, ProjectSettings settings)

Properties
Property Description
Name Gets the project name based on ProjectSettings.ProjectPath.
Settings Gets the project settings.
Metadata Gets the project metadata.
Configuration Gets the project configuration.
Methods
ToString

Gets the project information.

The formatted string follow this format

Configuring {Name} in {Configuration.BuildConfiguration} build with arguments:
generate code coverage: {Metadata.HasCodeCoverageArgument}
restore/build all projects: {Metadata.HasAllArgument}

ProjectSettings

Represents the settings for a project.

Properties
Property Description
ProjectPath Gets the main project path. This property is required.
TestPaths Gets all test project paths. Default value is ./test/**/*.csproj.
Paths Gets all project paths. Default value is ./**/*.csproj.
SolutionPath Gets the solution path. Giving a value will override other paths.

Metadata

Represent additional data for a project.

Constructor

Initializes a new instance of the Metadata

  • context: The context.
  • projectPath: The project path.

Metadata(ISetupContext context, FilePath projectPath)

Properties
Property Description
Version Gets the project version.
HasCodeCoverageArgument Gets a value indicating whether have code coverage argument or not.
HasAllArgument Gets a value indicating whether have all argument or not.
CurrentStep Gets the incremented step.
StepCount Gets the step count.

Configuration

Represent the project configuration.

Constructor

Initializes a new instance of the Configuration

  • context: The context.
  • hasCodeCoverageArgument: Value indicating whether have code coverage argument or not.

Configuration(ICakeContext context, bool hasCodeCoverageArgument)

Properties
Property Description
BuildConfiguration Gets the build configuration.
BuildSettings Gets the build settings to build the project.
TestSettings Gets the test settings to test the project.

BuildConfiguration

Represent the build configuration.

Value Description
BuildConfiguration.Release The release configuration
BuildConfiguration.Debug The debug configuration

NuGetPackage

Represent a NuGet package.

Constructor

Initializes a new instance of the NuGetPackage

  • context: The context.
  • project: the project.

NuGetPackage(ICakeContext context, Project project)

Properties
Property Description
Name Gets the NuGet name based on Project.Name
ProjectPath Gets the project path.
Version Gets the NuGet version.
PackSettings Gets the pack settings to pack the NuGet.
PushSettings Gets the NuGet push settings to push the NuGet.
Methods
ToString

Gets the NuGet information.

The formatted string follow this format

{Name}.{Version}\n

ICakeContext extensions

Clean

Clean all folders based on a glob pattern.

  • context: The ICakeContext context.
  • pattern: The pattern to search folders to be cleaned.

void Clean(this ICakeContext context, GlobPattern pattern)

GetVersion

Gets the cake version.

  • context: The ICakeContext context.

string GetVersion(this ICakeContext context)

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

GitHub repositories

This package is not used by any popular GitHub repositories.