README.md |
---|
Cross-platform addin for the Cake build automation system that adds Arguments extensions in Cake build scripts. The latest version of Cake.Args targets .NET 7.0, and .NET 6.0.
If you like or are using this project please give it a star. Thanks!
Simply add Cake.Args
in your build script by using the addin
directive:
#addin "nuget:?package=Cake.Args&version=3.0.0"
Make sure the &version=
attribute references the latest version of Cake.Args compatible with the Cake runner that you are using. Check the compatibility table to see which version of Cake.Args to choose.
And you're ready to use the arguments extensions in your Cake build script:
#addin "nuget:?package=Cake.Args&version=3.0.0"
var configuration =
ArgumentOrDefault<string>("configuration") ??
ArgumentOrDefault<string>("config") ??
"Release";
var majorVersion =
ArgumentOrDefault<int?>("majorVersion") ??
ArgumentOrDefault<int?>("major");
Task("Example")
.Does(context =>
{
var settings = new DotNetBuildSettings
{
Configuration = configuration,
};
if (majorVersion.HasValue)
{
settings.VersionSuffix = $"{majorVersion}.0.0";
}
DotNetBuild("./MyProject.sln", settings);
});
RunTarget("Example");
Method | Description |
---|---|
ArgumentOrDefault<T> |
Returns an argument value by name or default(T) if the argument is missing. |
Cake.Args is compatible with all Cake runners, and below you can find which version of Cake.Args you should use based on the version of the Cake runner you're using.
Cake runner | Cake.Args | Cake addin directive |
---|---|---|
3.0.0 or higher | 3.0.0 or higher | #addin "nuget:?package=Cake.Args&version=3.0.0" |
2.0.0 - 2.3.0 | 2.0.0 | #addin "nuget:?package=Cake.Args&version=2.0.0" |
1.0.0 - 1.3.0 | 1.0.0 - 1.0.1 | #addin "nuget:?package=Cake.Args&version=1.0.1" |
0.33.0 - 0.38.5 | 0.1.0 | #addin "nuget:?package=Cake.Args&version=0.1.0" |
< 0.33.0 | N/A | (not supported) |
For questions and to discuss ideas & feature requests, use the GitHub discussions on the Cake GitHub repository, under the Extension Q&A category.
Thanks goes to these wonderful people (emoji key):
C. Augusto Proiete 💻 🚧 |
Carlos Proiete 🚧 |
Click on the Releases tab on GitHub.
Copyright © 2021-2023 C. Augusto Proiete & Contributors - Provided under the MIT License.