Skip to content

BaseBuild Class

Definition

The base Nuke build class.

C#
[ShutdownDotNetAfterServerBuild]
public abstract class BaseBuild : NukeBuild, IHasConfiguration, IHasPlatform, IHasTargetFramework, ILint, IPack, IPublish, IReportCoverage, ITest, ICompile, IHasGitVersion, IHasArtifacts, IUpdatePackages, IListOutdatedPackages, IRestore, INukeBuild, IHasSolution

Inheritance object → Nuke.Common.NukeBuild

Implements IHasConfiguration, IHasPlatform, IHasTargetFramework, ILint, IPack, IPublish, IReportCoverage, ITest, ICompile, IHasGitVersion, IHasArtifacts, IUpdatePackages, IListOutdatedPackages, IRestore, Nuke.Common.INukeBuild, IHasSolution

Constructors

BaseBuild(bool)

Initializes a new instance of the BaseBuild class.

C#
public BaseBuild(bool disableConfigurationCheck = false)

Parameters

disableConfigurationCheck bool
Whether to validate generated configuration files.

Properties

RunLintInCI

Gets or sets a value indicating whether lint source code in CI builds.

C#
[Parameter("Whether to lint source code in CI builds")]
public bool RunLintInCI { get; set; }

RunPackInCD

Gets or sets a value indicating whether publish NuGet artifacts in CD builds.

C#
[Parameter("Whether to publish NuGet artifacts in CD builds")]
public bool RunPackInCD { get; set; }

RunPublishInCD

Gets or sets a value indicating whether publish binary artifacts in CD builds.

C#
[Parameter("Whether to publish binary artifacts in CD builds")]
public bool RunPublishInCD { get; set; }

Configuration

Gets or sets the configuration to build.

C#
[Parameter("Configuration to build - 'Debug' (default for local build) or 'Release' (default for server)")]
public Configuration Configuration { get; set; }

Platform

Gets or sets the platform to build.

C#
[Parameter("Platform to build - default depends on the solution")]
public string? Platform { get; set; }

Solution

Gets or sets the solution to build.

C#
[Solution(SuppressBuildProjectCheck = true)]
public Solution? Solution { get; set; }

TargetFramework

Gets or sets the .NET target framework to use.

C#
[Parameter(".NET target framework to use - default depends on the solution")]
public string? TargetFramework { get; set; }

ArtifactsDirectory

Gets or sets the output folder for artifacts.

C#
[Parameter("Output folder for artifacts")]
public AbsolutePath? ArtifactsDirectory { get; set; }

CodeCoverageDirectory

Gets or sets the output folder for code coverage.

C#
[Parameter("Output folder for code coverage")]
public AbsolutePath? CodeCoverageDirectory { get; set; }

NuGetDirectory

Gets or sets the output folder for NuGet packages.

C#
[Parameter("Output folder for NuGet packages")]
public AbsolutePath? NuGetDirectory { get; set; }

PublishDirectory

Gets or sets the output folder for binaries.

C#
[Parameter("Output folder for binaries")]
public AbsolutePath? PublishDirectory { get; set; }

TestResultDirectory

Gets or sets the output folder for test results.

C#
[Parameter("Output folder for test results")]
public AbsolutePath? TestResultDirectory { get; set; }

PublishFrameworks

Gets or sets the .NET target framework to publish.

C#
[Parameter(".NET target framework to publish - default depends on the solution")]
public string[]? PublishFrameworks { get; set; }

PublishProjects

Gets or sets the .NET projects to publish.

C#
[Parameter(".NET projects to publish - default is the solution")]
public string[]? PublishProjects { get; set; }

ZipPublishOutput

Gets or sets a value indicating whether to create ZIP file of each published directory.

C#
[Parameter("Whether to create ZIP file of each published directory")]
public bool ZipPublishOutput { get; set; }

ValidatePublishOutput

Gets or sets a mapping from project name to its expected publish output.

C#
[Parameter("A mapping from project name to its expected publish output.")]
public string[]? ValidatePublishOutput { get; set; }

TestFilter

Gets or sets the filter for which tests to run.

C#
[Parameter("Filter for which tests to run")]
public string? TestFilter { get; set; }

TestCollect

Gets or sets the data collector to use for the test run.

C#
[Parameter("Data collector to use for the test run")]
public string? TestCollect { get; set; }

PublishCoverageHTML

Gets or sets a value indicating whether to publish HTML to view test coverage.

C#
[Parameter("Whether to publish HTML to view test coverage")]
public bool PublishCoverageHTML { get; set; }

AddFeatureBranchNameToVersion

Gets or sets a value indicating whether to add the feature branch name to NuGet package versions.

C#
[Parameter("Whether to add the feature branch name to NuGet package versions")]
public bool AddFeatureBranchNameToVersion { get; set; }

AddGitVersioning

Gets or sets a value indicating whether to add Nerdbank Git versioning metadata.

C#
[Parameter("Whether to add Nerdbank Git versioning metadata")]
public bool AddGitVersioning { get; set; }

CentralPackagesFile

Gets or sets the central NuGet packages file location.

C#
[Parameter("The central NuGet packages file location")]
public AbsolutePath? CentralPackagesFile { get; set; }

Interactive

Gets or sets a value indicating whether to interactively update packages.

C#
[Parameter("Whether to interactively update packages")]
public bool Interactive { get; set; }

PinnedPackages

Gets or sets the package IDs to skip updating dependencies.

C#
[Parameter("The package IDs to skip updating dependencies")]
public string[]? PinnedPackages { get; set; }

CI

Gets the target to run continuous integration.

C#
protected Target CI { get; }

CD

Gets the target to run continuous deployment.

C#
protected Target CD { get; }

Full

Gets the default target to run the full build.

C#
protected virtual Target Full { get; }

CreateBinLog

Gets the target to create a binary compilation log file.

C#
protected Target CreateBinLog { get; }

Methods

RunCI()

Runs continuous integration.

C#
protected virtual void RunCI()

RunCD()

Runs continuous deployment.

C#
protected virtual void RunCD()

RunCreateBinLog()

Creates a binary compilation log file.

C#
protected virtual void RunCreateBinLog()