summaryrefslogtreecommitdiff
path: root/system/gd/rust/common/Android.bp
blob: 26a006892fc2d51c02bbcf6b2bfe57549536dbd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "system_bt_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["system_bt_license"],
}

rust_library {
    name: "libbt_common",
    defaults: ["gd_rust_defaults"],
    crate_name: "bt_common",
    srcs: ["src/lib.rs"],
    edition: "2018",
    rustlibs: [
        "libtokio",
        "libnix",
        "liblazy_static",
        "liblog_rust",
        "libcxx",
        "libgrpcio",
    ],
    target: {
        android: {
            rustlibs: [
                "libandroid_logger",
                "librustutils",
            ],
            shared_libs: [
                "libcutils",
            ],
        },
        host: {
            rustlibs: [
                "libenv_logger",
            ],
        },
    },
    proc_macros: [
        "libpaste",
    ],
    apex_available: [
        "//apex_available:platform",
        "com.android.bluetooth",
    ],
    min_sdk_version: "30",
}

rust_test_host {
    name: "libbt_common_inline_tests",
    srcs: ["src/lib.rs"],
    test_suites: ["general-tests"],
    auto_gen_config: true,
    rustlibs: [
        "libtokio",
        "libnix",
        "liblazy_static",
        "liblog_rust",
        "libenv_logger",
        "libcxx",
        "libgrpcio",
    ],
    proc_macros: [
        "libpaste",
    ],
}