-
Notifications
You must be signed in to change notification settings - Fork 3
/
BUILD
43 lines (40 loc) · 1.11 KB
/
BUILD
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
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_test")
rust_binary(
name = "bazel-lsp",
srcs = glob(["src/**/*.rs"]),
compile_data = [
"//src/builtin:builtin.pb",
"//src/builtin:default_build_language.pb",
],
rustc_env_files = [":generate_rustc_env_file"],
deps = [
"//src/builtin:build_proto_rust",
"//src/builtin:builtin_proto_rust",
"@crates//:anyhow",
"@crates//:clap",
"@crates//:prost",
"@crates//:either",
"@crates//:hex",
"@crates//:lsp-types",
"@crates//:ring",
"@crates//:serde_json",
"@crates//:starlark",
"@crates//:starlark_lsp",
"@crates//:thiserror",
],
)
genrule(
name = "generate_rustc_env_file",
srcs = [
"Cargo.toml",
"src/main.rs",
],
outs = ["rustc_env_file"],
cmd = "echo \"CARGO_PKG_VERSION=$$($(location @rust_host_tools//:cargo) read-manifest | jq -r .version)\" > $@",
tools = ["@rust_host_tools//:cargo"],
)
rust_test(
name = "unit_tests",
crate = ":bazel-lsp",
data = glob(["fixtures/**/*"]),
)