Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Latest commit

 

History

History

file_hash

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

file_hash

Bazel rule for hashing. Supports MD5, SHA1, SHA256, SHA512.

Setup and usage via Bazel

WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

# file_hash is written in Go and hence needs rules_go to be built.
# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
http_archive(
    name = "io_bazel_rules_go",
)

git_repository(
    name = "com_github_ash2k_bazel_tools",
    commit = "<commit>",
    remote = "https://github.com/ash2k/bazel-tools.git",
    shallow_since = "<bla>",
)

BUILD.bazel file:

load("@com_github_ash2k_bazel_tools//file_hash:def.bzl", "file_hash")

file_hash(
    name = "something_sha256",
    algorithm = "sha256",
    hex = True,
    files = [
        "file1",
        "file2",
    ],
)