Cake.Args
:cake: :jigsaw: Cake addin that adds Arguments extensions in Cake builds
Install / Use
/learn @augustoproiete/Cake.ArgsREADME
| README.md | |:---|
<div align="center">
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.
</div>Give a Star! :star:
If you like or are using this project please give it a star. Thanks!
Getting started :rocket:
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");
Arguments extensions available
| Method | Description |
| ---------------------- | ----------------------------------------------------------------------------- |
| ArgumentOrDefault<T> | Returns an argument value by name or default(T) if the argument is missing. |
Compatibility
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) |
Discussion
For questions and to discuss ideas & feature requests, use the GitHub discussions on the Cake GitHub repository, under the Extension Q&A category.
Contributors
Thanks goes to these wonderful people (emoji key):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tbody> <tr> <td align="center"><a href="https://augustoproiete.net"><img src="https://avatars.githubusercontent.com/u/177608?v=4?s=100" width="100px;" alt="C. Augusto Proiete"/><br /><sub><b>C. Augusto Proiete</b></sub></a><br /><a href="https://github.com/augustoproiete/Cake.Args/commits?author=augustoproiete" title="Code">💻</a> <a href="#maintenance-augustoproiete" title="Maintenance">🚧</a></td> <td align="center"><a href="https://github.com/carlosproiete"><img src="https://avatars.githubusercontent.com/u/33644328?v=4?s=100" width="100px;" alt="Carlos Proiete"/><br /><sub><b>Carlos Proiete</b></sub></a><br /><a href="#maintenance-carlosproiete" title="Maintenance">🚧</a></td> </tr> </tbody> </table> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->Release History
Click on the Releases tab on GitHub.
Copyright © 2021-2023 C. Augusto Proiete & Contributors - Provided under the MIT License.
