blob: af35aa1214e9f8d15bf5fa19a2422aa0f2c4bb80 [file] [log] [blame]
# Copyright 2023 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/components.gni")
import("//build/rust/rustc_binary.gni")
import("//src/sys/core/build/core_shard.gni")
rustc_binary("bin") {
edition = "2021"
output_name = "bt_le_battery_monitor"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.bluetooth.gatt2:fuchsia.bluetooth.gatt2_rust",
"//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le_rust",
"//src/connectivity/bluetooth/lib/fuchsia-bluetooth",
"//src/lib/async-utils",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//src/connectivity/bluetooth/lib/async-helpers:async-test-helpers",
"//src/lib/async-utils",
"//third_party/rust_crates:assert_matches",
]
sources = [ "src/main.rs" ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_component("component") {
component_name = "bt-le-battery-monitor"
manifest = "meta/bt-le-battery-monitor.cml"
deps = [ ":bin" ]
}
fuchsia_package("bt-le-battery-monitor") {
deps = [ ":component" ]
}
# The core realm shard to be used by product integrators.
core_shard("core-shard") {
shard_file = "meta/bt-le-battery-monitor.core_shard.cml"
}
fuchsia_unittest_package("bt-le-battery-monitor-tests") {
deps = [ ":bin_test" ]
}
group("tests") {
testonly = true
deps = [ ":bt-le-battery-monitor-tests" ]
}