1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "frameworks_native_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["frameworks_native_license"],
8}
9
10cc_defaults {
11    name: "fakeservicemanager_defaults",
12    host_supported: true,
13    srcs: [
14        "FakeServiceManager.cpp",
15    ],
16
17    shared_libs: [
18        "libbinder",
19        "libutils",
20        "liblog",
21    ],
22    target: {
23        darwin: {
24            enabled: false,
25        },
26    },
27}
28
29cc_library {
30    name: "libfakeservicemanager",
31    defaults: ["fakeservicemanager_defaults"],
32    export_include_dirs: ["include"],
33}
34
35cc_test_host {
36    name: "fakeservicemanager_test",
37    defaults: ["fakeservicemanager_defaults"],
38    srcs: [
39        "test_sm.cpp",
40    ],
41    static_libs: ["libgmock"],
42    local_include_dirs: ["include"],
43}
44
45rust_bindgen {
46    name: "libfakeservicemanager_bindgen",
47    crate_name: "fakeservicemanager_bindgen",
48    host_supported: true,
49    wrapper_src: "rust/wrappers/FakeServiceManagerWrapper.hpp",
50    source_stem: "bindings",
51    visibility: [":__subpackages__"],
52    bindgen_flags: [
53        "--allowlist-function",
54        "setupFakeServiceManager",
55        "--allowlist-function",
56        "clearFakeServiceManager",
57    ],
58    shared_libs: [
59        "libc++",
60        "libbinder",
61        "libfakeservicemanager",
62    ],
63}
64
65rust_library {
66    name: "libfakeservicemanager_rs",
67    crate_name: "fakeservicemanager_rs",
68    host_supported: true,
69    srcs: [
70        "rust/src/lib.rs",
71    ],
72    shared_libs: [
73        "libc++",
74        "libfakeservicemanager",
75    ],
76    rustlibs: [
77        "libfakeservicemanager_bindgen",
78    ],
79    lints: "none",
80    clippy_lints: "none",
81}
82