1package { 2 default_applicable_licenses: ["Android-Apache-2.0"], 3} 4 5rust_library { 6 name: "liblogger", 7 host_supported: true, 8 crate_name: "logger", 9 srcs: ["logger.rs"], 10 rustlibs: [ 11 "libenv_logger", 12 "liblog_rust", 13 ], 14 vendor_available: true, 15 target: { 16 android: { 17 rustlibs: [ 18 "libandroid_logger", 19 ] 20 }, 21 }, 22 apex_available: [ 23 "//apex_available:platform", 24 "com.android.uwb", 25 ], 26 min_sdk_version: "29", 27} 28 29rust_library { 30 name: "liblog_event_list", 31 crate_name: "log_event_list", 32 srcs: ["liblog_event_list.rs"], 33 rustlibs: ["liblog_event_list_bindgen"], 34 shared_libs: ["liblog"], 35} 36 37rust_defaults { 38 name: "liblogger_test_defaults", 39 crate_name: "logger", 40 test_suites: ["general-tests"], 41 auto_gen_config: true, 42 rustlibs: [ 43 "liblogger", 44 "liblog_rust", 45 ] 46} 47 48rust_test { 49 name: "logger_device_unit_tests", 50 defaults: ["liblogger_test_defaults"], 51 srcs: ["logger.rs"], 52 rustlibs: [ 53 "libenv_logger", 54 "libandroid_logger" 55 ] 56} 57 58rust_test_host { 59 name: "logger_host_unit_tests", 60 defaults: ["liblogger_test_defaults"], 61 srcs: ["logger.rs"], 62 rustlibs: ["libenv_logger"] 63} 64 65// The following tests are each run as separate targets because they all require a clean init state. 66rust_test { 67 name: "logger_test_default_init", 68 defaults: ["liblogger_test_defaults"], 69 host_supported: true, 70 srcs: ["tests/default_init.rs"], 71} 72 73rust_test { 74 name: "logger_test_env_log_level", 75 defaults: ["liblogger_test_defaults"], 76 host_supported: true, 77 srcs: ["tests/env_log_level.rs"], 78} 79 80rust_test { 81 name: "logger_test_config_log_level", 82 defaults: ["liblogger_test_defaults"], 83 host_supported: true, 84 srcs: ["tests/config_log_level.rs"], 85} 86 87rust_test { 88 name: "logger_test_multiple_init", 89 defaults: ["liblogger_test_defaults"], 90 host_supported: true, 91 srcs: ["tests/multiple_init.rs"], 92} 93