| # 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/config.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| rustc_binary("bin") { |
| edition = "2021" |
| output_name = "bt_fastpair_provider" |
| with_unit_tests = true |
| |
| deps = [ |
| ":fastpair_provider_config", |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.bluetooth.fastpair:fuchsia.bluetooth.fastpair_rust", |
| "//sdk/fidl/fuchsia.bluetooth.gatt2:fuchsia.bluetooth.gatt2_rust", |
| "//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le_rust", |
| "//sdk/fidl/fuchsia.bluetooth.sys:fuchsia.bluetooth.sys_rust", |
| "//src/connectivity/bluetooth/lib/async-helpers", |
| "//src/connectivity/bluetooth/lib/bt-metrics", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/connectivity/bluetooth/lib/host-watcher", |
| "//src/connectivity/bluetooth/lib/packet-encoding", |
| "//src/connectivity/bluetooth/lib/profile-client", |
| "//src/lib/async-utils", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/derive", |
| "//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/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:aes", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:base64", |
| "//third_party/rust_crates:bitfield", |
| "//third_party/rust_crates:elliptic-curve", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:hmac", |
| "//third_party/rust_crates:lru-cache", |
| "//third_party/rust_crates:p256", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:sha2", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//src/connectivity/bluetooth/lib/async-helpers:async-test-helpers", |
| "//src/lib/async-utils", |
| "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", |
| "//third_party/rust_crates:assert_matches", |
| ] |
| |
| sources = [ |
| "src/advertisement/bloom_filter.rs", |
| "src/advertisement/low_energy_advertiser.rs", |
| "src/advertisement/mod.rs", |
| "src/config.rs", |
| "src/fidl_client.rs", |
| "src/fidl_service.rs", |
| "src/gatt_service.rs", |
| "src/main.rs", |
| "src/message_stream.rs", |
| "src/pairing.rs", |
| "src/provider.rs", |
| "src/types/error.rs", |
| "src/types/keys.rs", |
| "src/types/mod.rs", |
| "src/types/packets.rs", |
| ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_component_manifest("manifest") { |
| component_name = "bt-fastpair-provider" |
| manifest = "meta/bt-fastpair-provider.cml" |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":manifest" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_structured_config_rust_lib("fastpair_provider_config") { |
| cm_label = ":manifest" |
| } |
| |
| fuchsia_unittest_package("bt-fastpair-provider-tests") { |
| manifest = "meta/bt-fastpair-provider-tests.cml" |
| deps = [ ":bin_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":bt-fastpair-provider-tests" ] |
| } |