-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathBUILD.bazel
64 lines (53 loc) · 1.58 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
57
58
59
60
61
62
63
64
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@io_bazel_rules_go//go:def.bzl", "nogo")
# gazelle:exclude build
# gazelle:exclude example
# gazelle:exclude generation_tests
# gazelle:rust_cargo_lockfile cargo.lock
# gazelle:rust_crates_prefix //3rdparty/crates:
exports_files(
srcs = ["cargo.lock"],
visibility = ["//visibility:public"],
)
# intended for users that just want rust
gazelle_binary(
name = "gazelle_bin",
languages = [
"//rust_language",
],
visibility = ["//visibility:public"],
)
# used by this project, which uses both rust and go
gazelle_binary(
name = "gazelle_bin_with_go",
languages = [
"//rust_language",
"@bazel_gazelle//language/go",
],
visibility = ["//visibility:public"],
)
gazelle(
name = "gazelle",
gazelle = ":gazelle_bin_with_go",
)
# gazelle:prefix github.com/calsign/gazelle_rust
gazelle(name = "gazelle_bootstrap")
gazelle(
name = "gazelle_update_repos",
args = [
"-from_file=go.mod",
"-to_macro=go_deps.bzl%go_dependencies",
"-prune",
],
command = "update-repos",
)
# NOTE: need to use the version of protobuf from rules_rust so that it matches
# gazelle:resolve rust protobuf @rules_rust//proto/protobuf/3rdparty/crates:protobuf
# NOTE: use cargo_bazel to parse the lockfile
# gazelle:resolve rust cargo_bazel @rules_rust//crate_universe:cargo_bazel
# NOTE: would like to use more checks, but the full suite doesn't succeed on some external libraries
nogo(
name = "nogo",
vet = True,
visibility = ["//visibility:public"],
)