package { default_visibility: ["//visibility:private"], } rust_protobuf_host { name: "libninja_frontend_protos", crate_name: "ninja_frontend_protos", protos: ["src/frontend.proto"], source_stem: "frontend", } rust_library_host { name: "libn2", crate_name: "n2", srcs: ["src/lib.rs"], edition: "2018", cargo_env_compat: true, // n2 prints the value of CARGO_PKG_VERSION when using the --version argument, we need to set // this property to define the environment variable, but don't actually care about the value. cargo_pkg_version: "android", features: ["built_with_soong"], rustlibs: [ "libanyhow", "libargh", "libdashmap", "liblibc", "librayon", "librustc_hash", "libninja_frontend_protos", "libprotobuf", ], } rust_binary_host { name: "n2", crate_name: "n2", srcs: ["src/main.rs"], edition: "2018", rustlibs: [ "libn2", "libanyhow", "libargh", "liblibc", "librustc_hash", ], } rust_test_host { name: "n2_unit_tests", srcs: ["src/lib.rs"], edition: "2018", cargo_env_compat: true, // n2 prints the value of CARGO_PKG_VERSION when using the --version argument, we need to set // this property to define the environment variable, but don't actually care about the value. cargo_pkg_version: "android", features: ["built_with_soong"], rustlibs: [ "libtempfile", "libanyhow", "libargh", "libdashmap", "liblibc", "librayon", "librustc_hash", "libninja_frontend_protos", "libprotobuf", ], } rust_test_host { name: "n2_e2e_tests", srcs: ["tests/e2e_test.rs"], edition: "2018", rustlibs: [ "libtempfile", "libanyhow", ], }