| # Copyright 2018 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_gap" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth_rust", |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.bluetooth.gatt:fuchsia.bluetooth.gatt_rust", |
| "//sdk/fidl/fuchsia.bluetooth.gatt2:fuchsia.bluetooth.gatt2_rust", |
| "//sdk/fidl/fuchsia.bluetooth.host:fuchsia.bluetooth.host_rust", |
| "//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le_rust", |
| "//sdk/fidl/fuchsia.bluetooth.sys:fuchsia.bluetooth.sys_rust", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_rust", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash_rust", |
| "//src/connectivity/bluetooth/lib/async-helpers", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/lib/async-utils", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-sync", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:slab", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ |
| "src/build_config.rs", |
| "src/generic_access_service.rs", |
| "src/host_device.rs", |
| "src/host_dispatcher.rs", |
| "src/main.rs", |
| "src/services/access.rs", |
| "src/services/bootstrap.rs", |
| "src/services/configuration.rs", |
| "src/services/host_watcher.rs", |
| "src/services/mod.rs", |
| "src/services/pairing/mod.rs", |
| "src/services/pairing/pairing_dispatcher.rs", |
| "src/services/pairing/pairing_requests.rs", |
| "src/store/in_memory.rs", |
| "src/store/keys.rs", |
| "src/store/mod.rs", |
| "src/store/serde.rs", |
| "src/store/stash.rs", |
| "src/test/access.rs", |
| "src/test/configuration.rs", |
| "src/test/discovery.rs", |
| "src/test/host_device.rs", |
| "src/test/host_dispatcher.rs", |
| "src/test/mod.rs", |
| "src/test/pairing.rs", |
| "src/test/receiver.rs", |
| "src/types.rs", |
| "src/watch_peers.rs", |
| ] |
| |
| test_deps = [ |
| "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", |
| "//src/lib/test_util", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:proptest", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| resource("default-config") { |
| sources = [ "config/default.json" ] |
| outputs = [ "data/bt-gap-default.json" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "bt-gap" |
| manifest = "meta/bt-gap.cml" |
| deps = [ |
| ":bin", |
| ":default-config", |
| ] |
| } |
| |
| fuchsia_package("bt-gap") { |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_test_component("test-stash-secure") { |
| deps = [ "//src/sys/stash:bin" ] |
| manifest = "meta/test-stash-secure.cml" |
| } |
| |
| fuchsia_test_component("test-component") { |
| manifest = "meta/bt-gap-unittests.cml" |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_test_package("bt-gap-unittests") { |
| # The max severity is set to ERROR due to expected ERROR messages in: |
| # - new_stash_fails_with_malformed_key_value_entry (ERROR with malformed string) |
| # - test_commit_bootstrap_doesnt_fail_from_host_failure (ERROR log is expected, should continue) |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| test_components = [ ":test-component" ] |
| deps = [ |
| ":default-config", |
| ":test-stash-secure", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":bt-gap-unittests" ] |
| } |