| # 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") { |
| output_name = "bt_gap" |
| with_unit_tests = true |
| |
| deps = [ |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth-rustc", |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr-rustc", |
| "//sdk/fidl/fuchsia.bluetooth.gatt:fuchsia.bluetooth.gatt-rustc", |
| "//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le-rustc", |
| "//sdk/fidl/fuchsia.bluetooth.sys:fuchsia.bluetooth.sys-rustc", |
| "//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt-rustc", |
| "//sdk/fidl/fuchsia.device:fuchsia.device-rustc", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger-rustc", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc", |
| "//src/connectivity/bluetooth/fidl:host-rustc", |
| "//src/connectivity/bluetooth/lib/async-helpers", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/lib/async-utils", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/storage/fuchsia-vfs-watcher", |
| "//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:futures-test", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:pin-utils", |
| "//third_party/rust_crates:proptest", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:slab", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "src/build_config.rs", |
| "src/devices.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/types.rs", |
| "src/watch_peers.rs", |
| ] |
| |
| test_deps = [ "//src/lib/test_util" ] |
| |
| configs -= [ "//build/config/rust:allow_unused_results" ] |
| } |
| |
| resource("default-config") { |
| sources = [ "config/default.json" ] |
| outputs = [ "data/bt-gap-default.json" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "bt-gap" |
| deps = [ |
| ":bin", |
| ":default-config", |
| ] |
| manifest = "meta/bt-gap.cmx" |
| } |
| |
| # TODO(fxbug.dev/72960): This v2 component is not yet used in production - it currently exists for |
| # testing scenarios only. |
| fuchsia_component("component-v2") { |
| component_name = "bt-gap" |
| manifest = "meta/bt-gap.cml" |
| deps = [ |
| ":bin", |
| ":default-config", |
| ] |
| } |
| |
| fuchsia_package("bt-gap") { |
| deps = [ |
| ":component", |
| ":component-v2", |
| ] |
| } |
| |
| fuchsia_test_component("test-stash-secure") { |
| deps = [ "//src/sys/stash:bin" ] |
| manifest = "meta/test-stash-secure.cml" |
| } |
| |
| fuchsia_test_component("test-driver") { |
| deps = [ ":bin_test" ] |
| manifest = "meta/test-driver.cml" |
| } |
| |
| fuchsia_test_component("test-component") { |
| manifest = "meta/bt-gap-unittests.cml" |
| } |
| |
| fuchsia_test_package("bt-gap-unittests") { |
| test_components = [ ":test-component" ] |
| deps = [ |
| ":default-config", |
| ":test-driver", |
| ":test-stash-secure", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":bt-gap-unittests" ] |
| } |