fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
8c9d5c70
0.8.0
1load ( "@bazel_skylib//:bzl_library.bzl" , "bzl_library" ) 2load ( "//rust:defs.bzl" , "rust_binary" , "rust_clippy" , "rust_library" , "rust_test" ) 3load ( "//tools:tool_utils.bzl" , "aspect_repository" ) 4 5rust_binary ( 6name = "gen_rust_project" , 7srcs = [ "main.rs" ], 8edition = "2018" , 9rustc_env = { 10"ASPECT_REPOSITORY" : aspect_repository (), 11}, 12visibility = [ "//visibility:public" ], 13deps = [ 14":gen_rust_project_lib" , 15"//tools/rust_analyzer/3rdparty/crates:anyhow" , 16"//tools/rust_analyzer/3rdparty/crates:clap" , 17"//tools/rust_analyzer/3rdparty/crates:env_logger" , 18"//tools/rust_analyzer/3rdparty/crates:log" , 19"//util/label" , 20], 21) 22 23rust_library ( 24name = "gen_rust_project_lib" , 25srcs = glob ( 26[ "**/*.rs" ], 27exclude = [ "main.rs" ], 28), 29data = [ 30"//rust/private:rust_analyzer_detect_sysroot" , 31], 32edition = "2018" , 33deps = [ 34"//tools/runfiles" , 35"//tools/rust_analyzer/3rdparty/crates:anyhow" , 36"//tools/rust_analyzer/3rdparty/crates:log" , 37"//tools/rust_analyzer/3rdparty/crates:serde" , 38"//tools/rust_analyzer/3rdparty/crates:serde_json" , 39], 40) 41 42rust_test ( 43name = "gen_rust_project_lib_test" , 44crate = ":gen_rust_project_lib" , 45deps = [ 46"//tools/rust_analyzer/3rdparty/crates:itertools" , 47], 48) 49 50rust_clippy ( 51name = "gen_rust_project_clippy" , 52testonly = True , 53visibility = [ "//visibility:private" ], 54deps = [ 55":gen_rust_project" , 56], 57) 58 59bzl_library ( 60name = "bzl_lib" , 61srcs = glob ([ "**/*.bzl" ]), 62visibility = [ "//visibility:public" ], 63deps = [ "//tools/rust_analyzer/3rdparty:bzl_lib" ], 64) 65 66filegroup ( 67name = "distro" , 68srcs = glob ([ 69"*.bzl" , 70"**/*.rs" , 71]) + [ 72"//tools/rust_analyzer/3rdparty:distro" , 73"BUILD.bazel" , 74], 75visibility = [ "//:__subpackages__" ], 76)