SecurityAliases.

CalculateDirectoryHash(ICakeContext, DirectoryPath, IEnumerable<string>, HashAlgorithm) Method

Summary

Calculates the hash for a given directory.
Namespace
Cake.Common.Security
Containing Type
SecurityAliases

Syntax

[CakeMethodAlias]
public static DirectoryHash CalculateDirectoryHash(this ICakeContext context, DirectoryPath directoryPath, IEnumerable<string> globs, HashAlgorithm hashAlgorithm)

Examples

Information(
    "Cake It calculates the hashes from all cs files in all subdirectories using a MD5 hash: {0}",
    CalculateDirectoryHash("C:\directoryToHash", "./**/*.cs", HashAlgorithm.MD5).ToHex());

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.

Parameters

Name Type Description
context ICakeContext The context.
directoryPath DirectoryPath The file path.
globs IEnumerable<string> The glob pattern to match.
hashAlgorithm HashAlgorithm The hash algorithm to use.

Return Value

Type Description
DirectoryHash A DirectoryHash instance representing the calculated hash.