anki/BUILD.bazel
Damien Elmes 1011dfec9b add script to run Rust Analyzer using Bazel's build products
Considerably speeds up initial load, but have not done much testing
yet.
2021-05-04 20:06:42 +10:00

50 lines
1.1 KiB
Python

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@rules_rust//rust:defs.bzl", "rust_analyzer")
config_setting(
name = "release",
values = {
"compilation_mode": "opt",
},
)
genrule(
name = "buildinfo",
srcs = ["//:defs.bzl"],
outs = ["buildinfo.txt"],
cmd = select({
"release": "$(location //scripts:buildinfo) $(location //:defs.bzl) bazel-out/stable-status.txt release > $@",
"//conditions:default": "$(location //scripts:buildinfo) $(location //:defs.bzl) bazel-out/stable-status.txt devel > $@",
}),
stamp = 1,
tools = [
"//scripts:buildinfo",
],
visibility = ["//visibility:public"],
)
alias(
name = "tsconfig.json",
actual = "//ts:tsconfig.json",
visibility = ["//visibility:public"],
)
pkg_tar(
name = "dist",
srcs = [
"//pylib/anki:wheel",
"//qt/aqt:wheel",
],
mode = "0644",
package_dir = "bazel-dist",
tags = ["manual"],
)
rust_analyzer(
name = "rust_analyzer",
targets = ["//rslib:anki"],
)
# for version info
exports_files(["defs.bzl"])