1load("@rules_license//rules:license.bzl", "license") 2load("@rules_license//rules:license_kind.bzl", "license_kind") 3load("@rules_rust//rust:defs.bzl", "rust_library") 4 5package( 6 default_applicable_licenses = [":license"], 7 default_visibility = ["//visibility:public"], 8) 9 10license( 11 name = "license", 12 license_kinds = [ 13 ":SPDX-license-identifier-Apache-2.0", 14 ":SPDX-license-identifier-MIT", 15 ], 16 license_text = "LICENSE-APACHE", 17 visibility = [":__subpackages__"], 18) 19 20license_kind( 21 name = "SPDX-license-identifier-Apache-2.0", 22 conditions = ["notice"], 23 url = "https://spdx.org/licenses/Apache-2.0.html", 24) 25 26license_kind( 27 name = "SPDX-license-identifier-MIT", 28 conditions = ["notice"], 29 url = "", 30) 31 32rust_library( 33 name = "zerocopy", 34 srcs = glob(["**/*.rs"]), 35 crate_features = [ 36 "byteorder", 37 "derive", 38 "simd", 39 "zerocopy-derive", 40 ], 41 edition = "2021", 42 proc_macro_deps = [ 43 # This should map to repo checked out from Android third party project 44 # "platform/external/rust/crates/zerocopy-derive". 45 "@zerocopy-derive", 46 ], 47 deps = [ 48 # Map to project repo "platform/external/rust/crates/byteorder". 49 "@byteorder", 50 ], 51) 52