aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYecheng Zhao <zyecheng@google.com>2023-10-10 18:18:25 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-10-10 18:18:25 +0000
commit049d27e45c39fdf06d5ea7a6336c4ab03bd94a41 (patch)
treee2d80a78b17bdf0c3cd9a9a106157793ddd26cc2
parent138bbaf6e3355b41665e9327f3757787e2093f68 (diff)
parent385582dfb568ca6d2ded1d65ea4ab7c8c7cc64cb (diff)
downloadproc-macro2-049d27e45c39fdf06d5ea7a6336c4ab03bd94a41.tar.gz
Add BUILD file for proc-macro2 kleaf build am: d3a23639db am: 385582dfb5
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/proc-macro2/+/2779911 Change-Id: I6ee378ae64189de006a98a87600867863c3dfaa2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--BUILD59
1 files changed, 59 insertions, 0 deletions
diff --git a/BUILD b/BUILD
new file mode 100644
index 0000000..7d96008
--- /dev/null
+++ b/BUILD
@@ -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"],
+)