Cake.DotNetLocalTools.Module
1.0.2
See the version list below for details.
dotnet add package Cake.DotNetLocalTools.Module --version 1.0.2
NuGet\Install-Package Cake.DotNetLocalTools.Module -Version 1.0.2
<PackageReference Include="Cake.DotNetLocalTools.Module" Version="1.0.2" />
paket add Cake.DotNetLocalTools.Module --version 1.0.2
#r "nuget: Cake.DotNetLocalTools.Module, 1.0.2"
#module nuget:?package=Cake.DotNetLocalTools.Module&version=1.0.2
Cake.DotNetLocalTools.Module
A Cake Module that extends Cake with functionality to install tools from a .NET tool manifest.
You can read the latest documentation at https://github.com/ap0llo/Cake.DotNetLocalTools.Module
Table of Contents
Overview
Cake allows installing .NET CLI Tools through the #tool
preprocessor directies and Cake.Frosting's InstallTool
method (see Installing and using tools for details).
.NET Core 3.1 introduced the concept of "local tools".
Local tools are listed in a "tool manifest" (dotnet-tools.json
) and run through the dotnet
command.
Cake.DotNetLocalTools.Module
brings these two concepts together.
It reads a list of tools from one or more tool manifests and install's them through Cake's tool infrastructure.
This way, you can easily use the tools from Cake while still having the tools and their versions described in a common format.
Usage
Cake Script
To use the module in a Cake script file, perform the following steps
Add the preprocessor directive to install the module
#module nuget:?package=Cake.DotNetLocalTools.Module&version=VERSION
Install tools using the
#tool
preprocessor directive and a uri scheme oftoolmanifest
:#tool "toolmanifest:?package=.config/dotnet-tools.json"
Cake.Frosting
To use the module in a Cake.Frosting project, perform the following steps.
Install the module package by adding a package reference to your project
<PackageReference Include="Cake.DotNetLocalTools.Module" Version="VERSION" />
Register
LocalToolsModule
with the Cake Host:using Cake.DotNetLocalTools.Module; public static int Main(string[] args) { return new CakeHost() // Register LocalToolsModule .UseModule<LocalToolsModule>() // Continue with the standard setup of a Cake.Frosting project .UseContext<BuildContext>() .Run(args); }
You can not install tools using either the
InstallToolsFromManifest()
method or usingInstallTools()
with a uri scheme oftoolmanifest
:using Cake.DotNetLocalTools.Module; public static int Main(string[] args) { return new CakeHost() // Register LocalToolsModule .UseModule<LocalToolsModule>() // Install Tools (both install options are equivalent) .InstallToolsFromManifest(".config/dotnet-tools.json") .InstallTools(new Uri("tool-manifest:?package=.config/dotnet-tools.json")) // Continue with the standard setup of a Cake.Frosting project .UseContext<BuildContext>() .Run(args); }
Example
Installing tools from a tool manifest is equivalent to installing the tools listed in the manifest using a #tool
preprocessor directive or through InstallTool()
.
For example, a tool manifest at .config/dotnet-tools.json
could look like this:
{
"version": 1,
"isRoot": true,
"tools": {
"nbgv": {
"version": "3.4.231",
"commands": [
"nbgv"
]
},
"dotnet-format": {
"version": "5.1.225507",
"commands": [
"dotnet-format"
]
},
"dotnet-reportgenerator-globaltool": {
"version": "4.8.12",
"commands": [
"reportgenerator"
]
}
}
}
Tools from the manifest can be installed using
#tool "toolmanifest:?package=.config/dotnet-tools.json"
This is equivalent to installing each tool individually:
#tool "dotnet:?package=nbgv&version=3.4.231"
#tool "dotnet:?package=dotnet-format&version=5.1.225507"
#tool "dotnet:?package=dotnet-reportgenerator-globaltool&version=4.8.12"
License
Cake.DotNetLocalTools.Module is licensed under the MIT License.
For details see https://github.com/ap0llo/Cake.DotNetLocalTools.Module/blob/master/LICENSE
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Cake.DotNetLocalTools.Module:
Repository | Stars |
---|---|
GitTools/GitVersion
From git log to SemVer in no time
|