mirror of
https://github.com/ankitects/anki.git
synced 2025-12-10 21:36:55 -05:00
add script to run Rust Analyzer using Bazel's build products
Considerably speeds up initial load, but have not done much testing yet.
This commit is contained in:
parent
4951ef12c9
commit
1011dfec9b
4 changed files with 16 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,3 +5,4 @@ anki.prof
|
||||||
target
|
target
|
||||||
user.bazelrc
|
user.bazelrc
|
||||||
.dmypy.json
|
.dmypy.json
|
||||||
|
rust-project.json
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
|
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
|
||||||
|
load("@rules_rust//rust:defs.bzl", "rust_analyzer")
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "release",
|
name = "release",
|
||||||
|
|
@ -39,5 +40,10 @@ pkg_tar(
|
||||||
tags = ["manual"],
|
tags = ["manual"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
rust_analyzer(
|
||||||
|
name = "rust_analyzer",
|
||||||
|
targets = ["//rslib:anki"],
|
||||||
|
)
|
||||||
|
|
||||||
# for version info
|
# for version info
|
||||||
exports_files(["defs.bzl"])
|
exports_files(["defs.bzl"])
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
"""Repo setup that can't happen until after defs.bzl:setup_deps() is run."""
|
"""Repo setup that can't happen until after defs.bzl:setup_deps() is run."""
|
||||||
|
|
||||||
load("@py_deps//:requirements.bzl", "pip_install")
|
load("@py_deps//:requirements.bzl", "pip_install")
|
||||||
|
load("@rules_rust//tools/rust_analyzer/raze:crates.bzl", "rules_rust_tools_rust_analyzer_fetch_remote_crates")
|
||||||
|
|
||||||
def setup_late_deps():
|
def setup_late_deps():
|
||||||
pip_install()
|
pip_install()
|
||||||
|
rules_rust_tools_rust_analyzer_fetch_remote_crates()
|
||||||
|
|
|
||||||
7
scripts/vscode-rust
Executable file
7
scripts/vscode-rust
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
bazel run @rules_rust//tools/rust_analyzer:gen_rust_project
|
||||||
|
code .
|
||||||
|
|
||||||
Loading…
Reference in a new issue