fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

Marcel HlopkoMigrate rules_rust main repository to defs.bzl and smaller rules (#987)bab14a47

0.11.0
1.5 KiB90 linesraw
1load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_clippy", "rust_library", "rust_test")
2
3package(default_visibility = ["//test:__subpackages__"])
4
5# Declaration of passing targets.
6
7rust_binary(
8    name = "ok_binary",
9    srcs = ["src/main.rs"],
10    edition = "2018",
11)
12
13rust_library(
14    name = "ok_library",
15    srcs = ["src/lib.rs"],
16    edition = "2018",
17)
18
19rust_test(
20    name = "ok_test",
21    srcs = ["src/lib.rs"],
22    edition = "2018",
23)
24
25# Clippy analysis of passing targets.
26
27rust_clippy(
28    name = "ok_binary_clippy",
29    deps = [":ok_binary"],
30)
31
32rust_clippy(
33    name = "ok_library_clippy",
34    deps = [":ok_library"],
35)
36
37rust_clippy(
38    name = "ok_test_clippy",
39    testonly = True,
40    deps = [":ok_test"],
41)
42
43# Declaration of failing targets.
44
45rust_binary(
46    name = "bad_binary",
47    srcs = ["bad_src/main.rs"],
48    edition = "2018",
49    tags = ["noclippy"],
50)
51
52rust_library(
53    name = "bad_library",
54    srcs = ["bad_src/lib.rs"],
55    edition = "2018",
56    tags = ["noclippy"],
57)
58
59rust_test(
60    name = "bad_test",
61    srcs = ["bad_src/lib.rs"],
62    edition = "2018",
63    tags = ["noclippy"],
64)
65
66# Clippy analysis of failing targets.
67
68rust_clippy(
69    name = "bad_binary_clippy",
70    tags = ["manual"],
71    deps = [":bad_binary"],
72)
73
74rust_clippy(
75    name = "bad_library_clippy",
76    tags = ["manual"],
77    deps = [":bad_library"],
78)
79
80rust_clippy(
81    name = "bad_test_clippy",
82    testonly = True,
83    tags = ["manual"],
84    deps = [":bad_test"],
85)
86
87sh_binary(
88    name = "clippy_failure_test",
89    srcs = ["clippy_failure_test.sh"],
90)