1package {
2    default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5rust_defaults {
6    name: "virtualizationmanager_defaults",
7    crate_name: "virtualizationmanager",
8    defaults: [
9        "avf_build_flags_rust",
10        "secretkeeper_use_latest_hal_aidl_rust",
11        "authgraph_use_latest_hal_aidl_rust",
12    ],
13    edition: "2021",
14    // Only build on targets which crosvm builds on.
15    enabled: false,
16    target: {
17        android64: {
18            compile_multilib: "64",
19            enabled: true,
20        },
21        linux_bionic_arm64: {
22            enabled: true,
23        },
24    },
25    prefer_rlib: true,
26    rustlibs: [
27        "android.system.virtualizationcommon-rust",
28        "android.system.virtualizationservice-rust",
29        "android.system.virtualizationservice_internal-rust",
30        "android.system.virtualmachineservice-rust",
31        "android.os.permissions_aidl-rust",
32        "libandroid_logger",
33        "libanyhow",
34        "libapkverify",
35        "libavf_features",
36        "libavflog",
37        "libbase_rust",
38        "libbinder_rs",
39        "libcfg_if",
40        "libclap",
41        "libcstr",
42        "libcommand_fds",
43        "libdisk",
44        "libglob",
45        "libhex",
46        "libhypervisor_props",
47        "liblazy_static",
48        "liblibc",
49        "liblog_rust",
50        "libmicrodroid_metadata",
51        "libmicrodroid_payload_config",
52        "libnested_virt",
53        "libnix",
54        "libonce_cell",
55        "libregex",
56        "librpcbinder_rs",
57        "librustutils",
58        "libsemver",
59        "libselinux_bindgen",
60        "libserde",
61        "libserde_json",
62        "libserde_xml_rs",
63        "libshared_child",
64        "libstatslog_virtualization_rust",
65        "libtombstoned_client_rust",
66        "libvbmeta_rust",
67        "libvm_control",
68        "libvmconfig",
69        "libzip",
70        "libvsock",
71        "liblibfdt",
72        "libfsfdt",
73        // TODO(b/202115393) stabilize the interface
74        "packagemanager_aidl-rust",
75    ],
76    shared_libs: [
77        "libselinux",
78    ],
79}
80
81rust_binary {
82    name: "virtmgr",
83    defaults: ["virtualizationmanager_defaults"],
84    srcs: ["src/main.rs"],
85    apex_available: ["com.android.virt"],
86}
87
88rust_test {
89    name: "virtualizationmanager_device_test",
90    srcs: ["src/main.rs"],
91    defaults: ["virtualizationmanager_defaults"],
92    rustlibs: [
93        "libtempfile",
94    ],
95    data: [
96        ":test_avf_debug_policy_with_ramdump",
97        ":test_avf_debug_policy_without_ramdump",
98        ":test_avf_debug_policy_with_adb",
99        ":test_avf_debug_policy_without_adb",
100    ],
101    test_suites: ["general-tests"],
102}
103
104cc_fuzz {
105    name: "virtualizationmanager_fuzzer",
106    defaults: ["service_fuzzer_defaults"],
107    srcs: ["fuzzer.cpp"],
108    static_libs: [
109        "android.system.virtualizationservice-ndk",
110        "libbase",
111    ],
112    shared_libs: [
113        "libbinder_ndk",
114        "libbinder_rpc_unstable",
115        "liblog",
116    ],
117    fuzz_config: {
118        cc: ["android-kvm@google.com"],
119    },
120}
121