This content is part of a third party extension that is not supported by the Cake project.
Summary
Installs package version from url, with
settings for integrity and everything else, and registers its files with context.Tools.
settings is not modified; if it also sets the package, version or URL to a different value,
the call fails.
Syntax
public static IReadOnlyCollection<FilePath> DownloadTool(this ICakeContext context, string package, string version, string url, DownloadToolSettings settings)
Examples
DownloadTool(
package: "cyclonedx",
version: "0.30.0",
url: "https://github.com/CycloneDX/cyclonedx-cli/releases/download/v{version}/cyclonedx-{rid}{exe}",
settings: new DownloadToolSettings()
.WithSha256("win-x64", "1f563ba9644d2f2966fc8029fd701ca4af4f388d44c017c1d60559a1ecc9114f")
.WithSha256("linux-x64", "f89876326620f5fc78a9b27cc1af57d6ed13d019aab87490e1246a44a910babb"));
Attributes
| Type |
Description |
| CakeMethodAliasAttribute |
|
Parameters
| Name |
Type |
Description |
| context |
ICakeContext |
The Cake context. |
| package |
string |
The tool name: install folder, default file name and default include. |
| version |
string |
The exact version; fills {version}. |
| url |
string |
The URL template, e.g. https://example.com/tool-{version}-{os}-{arch}{exe}. |
| settings |
DownloadToolSettings |
Integrity (required) and optional overrides. |
Return Value
| Type |
Description |
| IReadOnlyCollection<FilePath> |
The registered files. |