| # Copyright 2017 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_service" |
| with_unit_tests = true |
| |
| deps = [ |
| ":bt_le_battery_service_config", |
| "//sdk/fidl/fuchsia.bluetooth.gatt2:fuchsia.bluetooth.gatt2_rust", |
| "//src/connectivity/bluetooth/lib/battery-client", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-sync", |
| "//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", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:assert_matches", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_component_manifest("manifest") { |
| component_name = "bt-le-battery-service" |
| manifest = "meta/bt-le-battery-service.cml" |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":manifest" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_structured_config_rust_lib("bt_le_battery_service_config") { |
| cm_label = ":manifest" |
| } |
| |
| fuchsia_structured_config_values("default_config_values") { |
| cm_label = ":manifest" |
| values_source = "config/default.json5" |
| } |
| |
| fuchsia_package("bt-le-battery-service") { |
| deps = [ |
| ":component", |
| ":default_config_values", |
| ] |
| } |
| |
| # The core realm shard to be used by product integrators. |
| core_shard("core-shard") { |
| shard_file = "meta/bt-le-battery-service.core_shard.cml" |
| } |
| |
| fuchsia_unittest_package("bt-le-battery-service-tests") { |
| deps = [ ":bin_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":bt-le-battery-service-tests" ] |
| } |