fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
d974e0ea
rust-analyzer
1load ( "@rules_rust//rust:defs.bzl" , "rust_binary" , "rust_library" , "rust_test" ) 2 3package ( default_visibility = [ "//visibility:public" ]) 4 5rust_binary ( 6name = "print" , 7srcs = [ "main.rs" ], 8deps = [ 9":printer" , 10], 11) 12 13rust_library ( 14name = "printer" , 15srcs = [ 16"lib.rs" , 17"print_generic.rs" , 18] + select ({ 19"@rules_rust//rust/platform:linux" : [ 20":print_linux.rs" , 21], 22"@rules_rust//rust/platform:macos" : [ 23":print_macos.rs" , 24], 25"@rules_rust//rust/platform:windows" : [ 26":print_windows.rs" , 27], 28}), 29# Because each os specific file is conditionally added to the target, 30# rustfmt does not have all sources to complete formatting. To avoid 31# this failure, rustfmt is not run on this target 32tags = [ "norustfmt" ], 33) 34 35rust_test ( 36name = "printer_test" , 37crate = ":printer" , 38# The same rational used for `printer` applies here. Do not run rustfmt 39# since not all sources are available. 40tags = [ "norustfmt" ], 41)