B.25 FileHashTask

Calculates either MD5 or SHA1 hash value of a file and stores the value as a hex string in a property and generates a checksum file.

Other popular algorithms like "crc32" or "sha512" may be used with help of the algorithm attribute.

Table B.27: Attributes

hashtypeIntegerSpecifies what hash algorithm to use. 0=MD5, 1=SHA10No
algorithmStringSpecifies what hash algorithm to use. Supported algorithms. n/aNo
propertynameStringName of property where the hash value is stored.filehashvalueNo

B.25.1 Example

<filehash file="${builddir}/${tarball}.tar.${compression}" />
                <echo msg="Hashvalue is; ${filehashvalue}" />