fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
0f0b3543
main
1load ( "@bazel_skylib//rules:build_test.bzl" , "build_test" ) 2load ( "@rules_rust//rust:defs.bzl" , "rust_binary" , "rust_doc" ) 3 4package ( default_visibility = [ "//visibility:public" ]) 5 6rust_binary ( 7name = "hello_world_from_workspace_transient" , 8srcs = [ "src/main.rs" ], 9deps = [ 10"@crates_in_workspace//:anyhow" , 11], 12) 13 14rust_binary ( 15name = "hello_world_from_workspace_vendored" , 16srcs = [ "src/main.rs" ], 17deps = [ 18"//third-party-in-workspace/crates:anyhow" , 19], 20) 21 22rust_binary ( 23name = "hello_world_without_workspace_transient" , 24srcs = [ "src/main.rs" ], 25deps = [ 26"@crates_without_workspace//:anyhow" , 27], 28) 29 30[ 31rust_doc ( 32name = "hello_world_{}_doc" . format ( target ), 33crate = ":hello_world_{}" . format ( target ), 34) 35for target in [ 36"from_workspace_transient" , 37"from_workspace_vendored" , 38"without_workspace_transient" , 39] 40] 41 42[ 43sh_test ( 44name = "hello_world_{}_test" . format ( target ), 45srcs = [ "hello_world_test.sh" ], 46args = [ 47"$(rlocationpath :hello_world_{})" . format ( target ), 48], 49data = [ 50":hello_world_{}" . format ( target ), 51], 52deps = [ 53"@bazel_tools//tools/bash/runfiles" , 54], 55) 56for target in [ 57"from_workspace_transient" , 58"from_workspace_vendored" , 59"without_workspace_transient" , 60] 61] 62 63build_test ( 64name = "gen_rust_project" , 65targets = [ 66"@rules_rust//tools/rust_analyzer:gen_rust_project" , 67], 68) 69 70build_test ( 71name = "rust_fmt" , 72targets = [ 73"@rules_rust//:rustfmt" , 74], 75)