Grapeyard.Labs.Nuke.Launchpad
3.0.0
See the version list below for details.
dotnet add package Grapeyard.Labs.Nuke.Launchpad --version 3.0.0
NuGet\Install-Package Grapeyard.Labs.Nuke.Launchpad -Version 3.0.0
<PackageReference Include="Grapeyard.Labs.Nuke.Launchpad" Version="3.0.0" />
paket add Grapeyard.Labs.Nuke.Launchpad --version 3.0.0
#r "nuget: Grapeyard.Labs.Nuke.Launchpad, 3.0.0"
// Install Grapeyard.Labs.Nuke.Launchpad as a Cake Addin #addin nuget:?package=Grapeyard.Labs.Nuke.Launchpad&version=3.0.0 // Install Grapeyard.Labs.Nuke.Launchpad as a Cake Tool #tool nuget:?package=Grapeyard.Labs.Nuke.Launchpad&version=3.0.0
NUKE Launchpad
Quickstart and extension library for the build automation tool NUKE for C# and .NET.
It contains common feature extensions as well as predefined build parameters and build targets in the form of configurable build component interfaces, that enable quick and easy realization of lightweight build processes.
Installation
After setting up a NUKE build project as described in the NUKE documentation, install NUKE Launchpad by adding this package to it as a NuGet dependency using a NuGet package manager or by adding it manually to its project file:
<PackageReference Include="Grapeyard.Labs.Nuke.Launchpad" Version="3.0.0" />
This will automatically install all packages that are part of NUKE Launchpad and their transitive dependencies.
If the installation fails with NuGet error NU1202, update the target framework of the NUKE build project to a compatible version first – net9.0
or above – using its project properties or manually via its project file:
<TargetFramework>net9.0</TargetFramework>
Usage
For the fundamentals of working with NUKE, read its documentation first.
When utilizing NUKE, the build process of a solution is defined using a NUKE build project. The project contains a central build class, usually located in a file Build.cs
, that inherits the NukeBuild
class and defines build parameters and build targets, which are individual steps of the build process. Both build parameters and build targets may either be defined directly in the central build class or in the form of build component interfaces to be implemented by it.
NUKE Launchpad contains predefined build parameters and build targets in the form of configurable build component interfaces, that enable quick and easy realization of lightweight build processes, by simply making the central build class implement them:
using System;
using Grapeyard.Labs.Nuke.Launchpad.Parameters;
using Grapeyard.Labs.Nuke.Launchpad.Targets.Clean;
using Grapeyard.Labs.Nuke.Launchpad.Targets.Compile;
using Grapeyard.Labs.Nuke.Launchpad.Targets.Pack;
using Grapeyard.Labs.Nuke.Launchpad.Targets.Restore;
using Grapeyard.Labs.Nuke.Launchpad.Targets.Test;
using Nuke.Common;
using Nuke.Common.Git;
using static Grapeyard.Labs.Nuke.Launchpad.Common.BuildConfiguration;
/// <summary>
/// Entry point of the NUKE build project.
/// </summary>
public class Build
: NukeBuild,
IUsesGitRepository, // Optional parameter interface
ICleanForDotNet, // Target interfaces
IRestoreWithDotNet,
ICompileWithDotNet,
IUnitTestWithDotNet,
IPackWithDotNet
{
/// <inheritdoc/>
public string DefaultBuildConfiguration => Git.IsOnMainOrMasterBranch() ? Release : Debug;
/// <summary>
/// A representation of the local Git repository.
/// </summary>
/// <seealso cref="IUsesGitRepository.GitRepository"/>
private GitRepository Git => ((IUsesGitRepository) this).GitRepository;
/// <summary>
/// Invokes the build process and defines any number of default build targets.
/// </summary>
public static int Main()
{
return Execute<Build>(x => ((ITest) x).Test, x => ((IPack) x).Pack);
}
}
After modifying the central build class, the NUKE build project can be regenerated using the help command of NUKE, which also retrieves a list of available build parameters and build targets:
nuke --help
The parameter and target interfaces of NUKE Launchpad are documented extensively and should be self-explanatory. Check their code documentation before implementing them to be aware of potential quirks and configuration options.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net9.0
- Grapeyard.Labs.Nuke.Launchpad.Common (>= 3.0.0)
- Grapeyard.Labs.Nuke.Launchpad.Parameters (>= 3.0.0)
- Grapeyard.Labs.Nuke.Launchpad.Targets (>= 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Changed
• Breaking: Implemented the new params collections feature of C# 13 and renamed some of the affected methods to standardize their suffix:
◦ Added the params modifier to the enumerable parameter otherPaths of method IsContainedInAny of the AbsolutePathExtensions class, making it possible to use the method with a variable number of arguments.
◦ Renamed method IsAnyOf of the CharExtensions class to IsAny and changed the type of its charactersToSeek parameter from array to an enumerable collection.
◦ Renamed method ContainsAnyOf of the StringExtensions class to ContainsAny and changed the type of its textsToSeek parameter from array to an enumerable collection.
• Breaking: Moved all methods of class ToolSettingsExtensions into the ObjectExtensions class and renamed method WhenNotNull to WhenIsNotNull to avoid ambiguous method calls with the new WhenNotNull method of NuGet package Nuke.Common in version 9.0.0, which fulfills the same function but is not null-forgiving, causing CS8602 code analyzer errors in the method chain.
• Breaking: Changed the return type of method GitExitHandlerThatIgnoresEmptyCommits of the ExtendedGitTasks class from void to object to match the exit handler definition in NuGet package Nuke.Common, which was altered in version 9.0.0.
• Updated the target framework version from .NET 8 to .NET 9.
• Updated the target language version from C# 12 to C# 13.
• Updated dependencies to NuGet package Nuke.Common from version 8.1.4 to 9.0.1.
• Updated dependencies to NuGet package GitVersion.Tool from version 6.0.4 to 6.0.5.
Removed
• Breaking: Removed method IsContainedInAnyOf from the AbsolutePathExtensions class in favor of method IsContainedInAny, which takes over its function due to the implementation of the new params collections feature of C# 13.
• Breaking: Removed class ToolSettingsExtensions because the corresponding class ToolSettings was removed from NuGet package Nuke.Common in version 9.0.0.
Full changelog at https://gitlab.com/grapeyard-labs/libs/nuke-launchpad/-/blob/3.0.0/CHANGELOG.md