Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gradle/gradle-checksum
A Gradle plugin for creating checksums for files in your build.
https://github.com/gradle/gradle-checksum
gradle-bt gradle-bt-release-coordination
Last synced: about 1 month ago
JSON representation
A Gradle plugin for creating checksums for files in your build.
- Host: GitHub
- URL: https://github.com/gradle/gradle-checksum
- Owner: gradle
- License: apache-2.0
- Created: 2017-08-12T15:32:42.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-14T15:22:41.000Z (over 2 years ago)
- Last Synced: 2024-09-26T12:41:20.697Z (about 1 month ago)
- Topics: gradle-bt, gradle-bt-release-coordination
- Language: Groovy
- Size: 219 KB
- Stars: 36
- Watchers: 31
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gradle-checksum
A Gradle plugin for creating checksums for files in your build.# Requirements
- Version 1.4.0 requires Gradle 5.4 or above
- Version 1.3.0 requires Gradle 5.0 or above# Usage
```$gradle
plugins {
id 'org.gradle.crypto.checksum' version '1.4.0'
}import org.gradle.crypto.checksum.Checksum
task generateFiles {
// Generates some files.
}task createChecksums(type: Checksum, dependsOn: 'generateFiles') {
inputFiles.setFrom(generateFiles.outputs.files)
outputDirectory.set(layout.buildDirectory.dir("foo/checksums"))
checksumAlgorithm.set(Checksum.Algorithm.SHA512)
appendFileNameToChecksum.set(true)
}
```When the `createChecksums` task is finished, there will be a file ending in
`.sha512` for each of the files output by the `generateFiles` task.Currently, only `SHA256` (default), `SHA384`, `SHA512`, and `MD5` are
supported. Please file an issue or make a pull request if you need support
for some other hashing algorithm.If you want to append the filename to the checksum value, set `appendFileNameToChecksum` to true (`false` by default).
This makes it easier to automate the checksum verification with the `md5sum`, `sha256sum`, `sha384sum` or `sha512sum` tools:```
> sha512sum -c ../build/checksums/foo.txt.sha512
foo.txt: OK
```By default, the `outputDirectory` will be set to `project.buildDir + "checksums"`.
The task is incremental at the file level, and will only alter files in the
output directory which end with file extensions managed by this task
(e.g. `.sha256` or `.sha512`). However, for optimal caching of other tasks
it is still advisable to try and use independent output directories for
each task in your build.