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