1package {
2    default_team: "trendy_team_fwk_core_networking",
3    default_applicable_licenses: ["Android-Apache-2.0"],
4}
5
6rust_defaults {
7    name: "libremoteauth_jni_rust_defaults",
8    crate_name: "remoteauth_jni_rust",
9    lints: "android",
10    clippy_lints: "android",
11    min_sdk_version: "35",
12    srcs: ["src/lib.rs"],
13    rustlibs: [
14        "libbinder_rs",
15        "libjni_legacy",
16        "liblog_rust",
17        "liblogger",
18        "libnum_traits",
19        "libthiserror",
20        "libtokio",
21        "libanyhow",
22    ],
23    proc_macros: [
24        "libasync_trait",
25    ],
26    prefer_rlib: true,
27    apex_available: [
28        "com.android.remoteauth",
29    ],
30    host_supported: true,
31}
32
33rust_ffi_shared {
34    name: "libremoteauth_jni_rust",
35    defaults: ["libremoteauth_jni_rust_defaults"],
36    rustlibs: [],
37}
38
39rust_test {
40    name: "libremoteauth_jni_rust_tests",
41    defaults: ["libremoteauth_jni_rust_defaults"],
42    rustlibs: [
43    ],
44    target: {
45        android: {
46            test_suites: [
47                "general-tests",
48            ],
49            test_config_template: "remoteauth_rust_test_config_template.xml",
50        },
51        host: {
52            test_suites: [
53                "general-tests",
54            ],
55            data_libs: [
56                "libandroid_runtime_lazy",
57                "libbase",
58                "libbinder",
59                "libbinder_ndk",
60                "libcutils",
61                "liblog",
62                "libutils",
63            ],
64        },
65    },
66    test_options: {
67        unit_test: true,
68    },
69    // Support multilib variants (using different suffix per sub-architecture), which is needed on
70    // build targets with secondary architectures, as the MTS test suite packaging logic flattens
71    // all test artifacts into a single `testcases` directory.
72    compile_multilib: "both",
73    multilib: {
74        lib32: {
75            suffix: "32",
76        },
77        lib64: {
78            suffix: "64",
79        },
80    },
81    auto_gen_config: true,
82}
83