fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

UebelAndreMoved rust extension rules into a separate `rules_rust_ext` workspace. (#3007)2bad96d9

cleanup
1.6 KiB63 linesraw
1load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test")
2load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_shared_library")
3load("@rules_rust_wasm_bindgen//rules_nodejs:defs.bzl", "nodejs_rust_wasm_bindgen")
4
5rust_binary(
6    name = "hello_world_bin_wasm",
7    srcs = ["//test:main.rs"],
8    edition = "2018",
9    deps = [
10        "@rules_rust_wasm_bindgen//3rdparty:wasm_bindgen",
11    ],
12)
13
14rust_shared_library(
15    name = "hello_world_lib_wasm",
16    srcs = ["//test:main.rs"],
17    edition = "2018",
18    deps = [
19        "@rules_rust_wasm_bindgen//3rdparty:wasm_bindgen",
20    ],
21)
22
23nodejs_rust_wasm_bindgen(
24    name = "hello_world_bundler_wasm_bindgen",
25    wasm_file = ":hello_world_bin_wasm",
26)
27
28nodejs_rust_wasm_bindgen(
29    name = "hello_world_web_wasm_bindgen",
30    target = "web",
31    wasm_file = ":hello_world_lib_wasm",
32)
33
34nodejs_rust_wasm_bindgen(
35    name = "hello_world_deno_wasm_bindgen",
36    target = "deno",
37    wasm_file = ":hello_world_lib_wasm",
38)
39
40nodejs_rust_wasm_bindgen(
41    name = "hello_world_nomodules_wasm_bindgen",
42    target = "no-modules",
43    wasm_file = ":hello_world_lib_wasm",
44)
45
46nodejs_rust_wasm_bindgen(
47    name = "hello_world_nodejs_wasm_bindgen",
48    target = "nodejs",
49    wasm_file = ":hello_world_lib_wasm",
50)
51
52nodejs_test(
53    name = "hello_world_wasm_test",
54    args = ["rules_nodejs"],
55    data = [
56        ":hello_world_bundler_wasm_bindgen",
57        ":hello_world_deno_wasm_bindgen",
58        ":hello_world_nodejs_wasm_bindgen",
59        ":hello_world_nomodules_wasm_bindgen",
60        ":hello_world_web_wasm_bindgen",
61    ],
62    entry_point = "//test:hello_world_wasm_test.js",
63)