xref: /aosp_15_r20/external/bazelbuild-rules_rust/examples/proc_macro/BUILD.bazel (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1*d4726bddSHONG Yifanload(
2*d4726bddSHONG Yifan    "@rules_rust//rust:defs.bzl",
3*d4726bddSHONG Yifan    "rust_doc",
4*d4726bddSHONG Yifan    "rust_doc_test",
5*d4726bddSHONG Yifan    "rust_proc_macro",
6*d4726bddSHONG Yifan    "rust_test",
7*d4726bddSHONG Yifan)
8*d4726bddSHONG Yifan
9*d4726bddSHONG Yifanpackage(default_visibility = ["//visibility:public"])
10*d4726bddSHONG Yifan
11*d4726bddSHONG Yifanrust_proc_macro(
12*d4726bddSHONG Yifan    name = "proc_macro_lib_2015",
13*d4726bddSHONG Yifan    srcs = [
14*d4726bddSHONG Yifan        "src/lib_2015.rs",
15*d4726bddSHONG Yifan    ],
16*d4726bddSHONG Yifan)
17*d4726bddSHONG Yifan
18*d4726bddSHONG Yifanrust_proc_macro(
19*d4726bddSHONG Yifan    name = "proc_macro_lib",
20*d4726bddSHONG Yifan    srcs = [
21*d4726bddSHONG Yifan        "src/lib.rs",
22*d4726bddSHONG Yifan    ],
23*d4726bddSHONG Yifan    edition = "2018",
24*d4726bddSHONG Yifan)
25*d4726bddSHONG Yifan
26*d4726bddSHONG Yifanrust_test(
27*d4726bddSHONG Yifan    name = "proc_macro_test",
28*d4726bddSHONG Yifan    crate = ":proc_macro_lib",
29*d4726bddSHONG Yifan    edition = "2018",
30*d4726bddSHONG Yifan)
31*d4726bddSHONG Yifan
32*d4726bddSHONG Yifanrust_test(
33*d4726bddSHONG Yifan    name = "greeting_test",
34*d4726bddSHONG Yifan    srcs = ["tests/greeting.rs"],
35*d4726bddSHONG Yifan    edition = "2018",
36*d4726bddSHONG Yifan    proc_macro_deps = [":proc_macro_lib"],
37*d4726bddSHONG Yifan)
38*d4726bddSHONG Yifan
39*d4726bddSHONG Yifanrust_doc(
40*d4726bddSHONG Yifan    name = "proc_macro_lib_doc",
41*d4726bddSHONG Yifan    crate = ":proc_macro_lib",
42*d4726bddSHONG Yifan)
43*d4726bddSHONG Yifan
44*d4726bddSHONG Yifanrust_doc_test(
45*d4726bddSHONG Yifan    name = "doc_test",
46*d4726bddSHONG Yifan    crate = ":proc_macro_lib",
47*d4726bddSHONG Yifan)
48