-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
56 lines (52 loc) · 1.13 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This bazel package contains sources for the "myhasher" command-line tool.
# Keep BUILD.bazel formatted with `buildifier BUILD.bazel`
# Keep source files formatted with `bazelisk run @rules_rust//:rustfmt`
load(
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_clippy",
"rust_library",
"rust_test",
"rustfmt_test",
)
rust_library(
name = "myhasher_lib",
srcs = ["src/myhasher.rs"],
edition = "2021",
deps = [
"@third_party//:sha2",
],
)
rust_binary(
name = "myhasher",
srcs = [
"src/main.rs",
],
edition = "2021",
deps = [
":myhasher_lib",
"@third_party//:clap",
"@third_party//:googletest",
"@third_party//:hex",
"@third_party//:sha2",
],
)
rust_test(
name = "myhasher_test",
size = "small",
crate = "myhasher_lib",
deps = [
"@third_party//:googletest",
"@third_party//:hex",
],
)
# If this fails, you need to run:
# bazelisk run @rules_rust//:rustfmt
rustfmt_test(
name = "myhasher_fmt",
size = "small",
targets = [
":myhasher_lib",
":myhasher",
],
)