1//
2// Copyright (C) 2021 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20rust_binary {
21    name: "android.hardware.nfc-service.cuttlefish",
22    relative_install_path: "hw",
23    vendor: true,
24    prefer_rlib: true,
25    rustlibs: [
26        "android.hardware.nfc-V2-rust",
27        "libandroid_logger",
28        "libanyhow",
29        "libbinder_rs",
30        "libbinder_tokio_rs",
31        "libbytes",
32        "libclap",
33        "liblibc",
34        "liblog_rust",
35        "libnix",
36        "libpdl_runtime",
37        "libthiserror",
38        "libtokio",
39    ],
40    proc_macros: [
41        "libasync_trait",
42    ],
43    features: ["rt"],
44    srcs: [
45        "src/main.rs",
46        // TODO(b/381337280): src/main.rs must come first but bpfmt breaks this order without this comment.
47        ":casimir_nci_packets_rust_gen",
48    ],
49}
50
51prebuilt_etc {
52    name: "nfc-service-cuttlefish.rc",
53    src: "nfc-service-cuttlefish.rc",
54    installable: false,
55}
56
57prebuilt_etc {
58    name: "nfc-service-cuttlefish.xml",
59    src: "nfc-service-cuttlefish.xml",
60    sub_dir: "vintf",
61    installable: false,
62}
63
64apex {
65    name: "com.google.cf.nfc",
66    manifest: "apex_manifest.json",
67    file_contexts: "file_contexts",
68    key: "com.google.cf.apex.key",
69    certificate: ":com.google.cf.apex.certificate",
70    updatable: false,
71    vendor: true,
72
73    binaries: ["android.hardware.nfc-service.cuttlefish"],
74    prebuilts: [
75        "android.hardware.nfc.hce.prebuilt.xml", // permission
76        "android.hardware.nfc.prebuilt.xml", // permission
77        "libnfc-hal-cf.conf-default", // conf
78        "nfc-service-cuttlefish.rc", // init_rc
79        "nfc-service-cuttlefish.xml", // vintf_fragments
80    ],
81}
82