fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
a7aba2d0
main
1load ( "@aspect_rules_js//js:defs.bzl" , "js_library" , "js_test" ) 2load ( "@bazel_skylib//rules:build_test.bzl" , "build_test" ) 3load ( "@rules_rust//rust:defs.bzl" , "rust_binary" , "rust_shared_library" ) 4load ( "@rules_rust_wasm_bindgen//rules_js:defs.bzl" , "js_rust_wasm_bindgen" ) 5 6rust_binary ( 7name = "hello_world_bin_wasm" , 8srcs = [ "//test:main.rs" ], 9edition = "2018" , 10deps = [ 11"@rules_rust_wasm_bindgen//3rdparty:wasm_bindgen" , 12], 13) 14 15rust_shared_library ( 16name = "hello_world_lib_wasm" , 17srcs = [ "//test:main.rs" ], 18edition = "2018" , 19deps = [ 20"@rules_rust_wasm_bindgen//3rdparty:wasm_bindgen" , 21], 22) 23 24js_rust_wasm_bindgen ( 25name = "hello_world_bundler_wasm_bindgen" , 26wasm_file = ":hello_world_bin_wasm" , 27) 28 29js_rust_wasm_bindgen ( 30name = "hello_world_web_wasm_bindgen" , 31target = "web" , 32wasm_file = ":hello_world_lib_wasm" , 33) 34 35js_rust_wasm_bindgen ( 36name = "hello_world_deno_wasm_bindgen" , 37target = "deno" , 38wasm_file = ":hello_world_lib_wasm" , 39) 40 41js_rust_wasm_bindgen ( 42name = "hello_world_nomodules_wasm_bindgen" , 43target = "no-modules" , 44wasm_file = ":hello_world_lib_wasm" , 45) 46 47js_rust_wasm_bindgen ( 48name = "hello_world_nodejs_wasm_bindgen" , 49target = "nodejs" , 50wasm_file = ":hello_world_lib_wasm" , 51) 52 53js_rust_wasm_bindgen ( 54name = "hello_world_nodejs_no_typescript_wasm_bindgen" , 55bindgen_flags = [ 56"--no-typescript" , 57], 58target = "nodejs" , 59wasm_file = ":hello_world_lib_wasm" , 60) 61 62_WASM_DATA = [ 63":hello_world_bundler_wasm_bindgen" , 64":hello_world_deno_wasm_bindgen" , 65":hello_world_nodejs_wasm_bindgen" , 66":hello_world_nomodules_wasm_bindgen" , 67":hello_world_web_wasm_bindgen" , 68] 69 70js_test ( 71name = "hello_world_wasm_direct_test" , 72data = _WASM_DATA , 73entry_point = "hello_world_wasm_test.js" , 74) 75 76js_library ( 77name = "hello_world_wasm_lib" , 78srcs = [ 79"hello_world_wasm_test.js" , 80], 81data = _WASM_DATA , 82deps = [], 83) 84 85js_test ( 86name = "hello_world_wasm_lib_test" , 87data = [ 88":hello_world_wasm_lib" , 89], 90entry_point = ":hello_world_wasm_lib" , 91) 92 93build_test ( 94name = "build_test" , 95targets = _WASM_DATA , 96)