diff options
author | Yecheng Zhao <zyecheng@google.com> | 2023-10-10 19:03:07 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-10-10 19:03:07 +0000 |
commit | 91c2cad75cada07943032e5822e1653afb8e5d38 (patch) | |
tree | e2d80a78b17bdf0c3cd9a9a106157793ddd26cc2 | |
parent | 3a2db65a8c3584ccf9be434389a8f1141db4c1ca (diff) | |
parent | 049d27e45c39fdf06d5ea7a6336c4ab03bd94a41 (diff) | |
download | proc-macro2-91c2cad75cada07943032e5822e1653afb8e5d38.tar.gz |
Add BUILD file for proc-macro2 kleaf build am: d3a23639db am: 385582dfb5 am: 049d27e45c
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/proc-macro2/+/2779911
Change-Id: I5d451bcdcfefee1c507cae47d0f07de9e4d73a37
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | BUILD | 59 |
1 files changed, 59 insertions, 0 deletions
@@ -0,0 +1,59 @@ +load("@rules_license//rules:license.bzl", "license") +load("@rules_license//rules:license_kind.bzl", "license_kind") +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package( + default_applicable_licenses = [":license"], + default_visibility = ["//visibility:public"], +) + +license( + name = "license", + license_kinds = [ + ":SPDX-license-identifier-Apache-2.0", + ":SPDX-license-identifier-MIT", + ], + license_text = "LICENSE-APACHE", + visibility = [":__subpackages__"], +) + +license_kind( + name = "SPDX-license-identifier-Apache-2.0", + conditions = ["notice"], + url = "https://spdx.org/licenses/Apache-2.0.html", +) + +license_kind( + name = "SPDX-license-identifier-MIT", + conditions = ["notice"], + url = "", +) + +CRATE_FEATURES = [ + "default", + "proc-macro", + "span-locations", +] + +rust_library( + name = "proc-macro2", + srcs = glob(["**/*.rs"]), + crate_features = CRATE_FEATURES, + edition = "2021", + deps = [ + ":proc-macro2_build_script", + # This should map to repo checked out from Android third party project + # "platform/external/rust/crates/unicode-ident". + "@unicode-ident", + ], +) + +cargo_build_script( + name = "proc-macro2_build_script", + srcs = glob(["**/*.rs"]), + crate_features = CRATE_FEATURES, + crate_root = "build.rs", + edition = "2021", + visibility = ["//visibility:private"], +) |