1rust_library { 2 name: "librdroidtest", 3 host_supported: true, 4 crate_name: "rdroidtest", 5 cargo_env_compat: true, 6 cargo_pkg_version: "0.1.0", 7 srcs: ["src/lib.rs"], 8 edition: "2021", 9 rustlibs: [ 10 "liblibtest_mimic", 11 "liblinkme", 12 "liblog_rust", 13 "liblogger", 14 ], 15 proc_macros: [ 16 "libpaste", 17 "librdroidtest_macro", 18 ], 19 apex_available: [ 20 "//apex_available:platform", 21 "//apex_available:anyapex", 22 ], 23 vendor_available: true, 24} 25 26rust_proc_macro { 27 name: "librdroidtest_macro", 28 crate_name: "rdroidtest_macro", 29 cargo_env_compat: true, 30 cargo_pkg_version: "0.1.0", 31 srcs: ["macro/lib.rs"], 32 edition: "2021", 33 rustlibs: [ 34 "libproc_macro2", 35 "libquote", 36 "libsyn", 37 ], 38} 39 40rust_defaults { 41 name: "rdroidtest.defaults", 42 test_harness: false, 43 cfgs: ["test"], 44 proc_macros: ["librdroidtest_macro"], 45 rustlibs: [ 46 "librdroidtest", 47 "liblinkme", 48 ], 49 // Without this flag we get linker errors saying to add it. See 50 // https://github.com/dtolnay/linkme/issues/49 and related issues. 51 ld_flags: [ 52 "-z", 53 "nostart-stop-gc", 54 ], 55} 56 57rust_test { 58 name: "librdroidtest_test", 59 srcs: ["tests/main.rs"], 60 test_suites: [ 61 "general-tests", 62 ], 63 host_supported: true, 64 defaults: ["rdroidtest.defaults"], 65} 66