blob: 4ca1f2f3a9511c36883d3b22d31d6d930c988066 [file] [log] [blame]
# Copyright 2022 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")
rustc_binary("bin") {
edition = "2021"
output_name = "bt_peripheral_hub"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.bluetooth.power:fuchsia.bluetooth.power-rustc",
"//sdk/fidl/fuchsia.power.battery:fuchsia.power.battery-rustc",
"//src/connectivity/bluetooth/lib/fuchsia-bluetooth",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [ "//third_party/rust_crates:assert_matches" ]
sources = [
"src/error.rs",
"src/fidl_service.rs",
"src/main.rs",
"src/peripheral_state.rs",
"src/reporter.rs",
"src/watcher.rs",
]
configs -= [ "//build/config/rust:allow_unused_results" ]
}
fuchsia_component("component") {
component_name = "bt-peripheral-hub"
manifest = "meta/bt-peripheral-hub.cml"
deps = [ ":bin" ]
}
fuchsia_package("bt-peripheral-hub") {
deps = [ ":component" ]
}
fuchsia_unittest_package("bt-peripheral-hub-tests") {
deps = [ ":bin_test" ]
}
group("tests") {
testonly = true
deps = [ ":bt-peripheral-hub-tests" ]
}