• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

gradle/gradle-checksum: A Gradle plugin for creating checksums for files in your ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

gradle/gradle-checksum

开源软件地址(OpenSource Url):

https://github.com/gradle/gradle-checksum

开源编程语言(OpenSource Language):

Groovy 57.6%

开源软件介绍(OpenSource Introduction):

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

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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap