blob: 6698bd4a3f5cf4ae4f73a9bd413935ec0dcdc796 [file] [log] [blame]
# Copyright 2019 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_avrcp"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth_rust",
"//sdk/fidl/fuchsia.bluetooth.avrcp:fuchsia.bluetooth.avrcp_rust",
"//sdk/fidl/fuchsia.bluetooth.avrcp.test:fuchsia.bluetooth.avrcp.test_rust",
"//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust",
"//src/connectivity/bluetooth/lib/bt-avctp",
"//src/connectivity/bluetooth/lib/bt-metrics",
"//src/connectivity/bluetooth/lib/fuchsia-bluetooth",
"//src/connectivity/bluetooth/lib/packet-encoding",
"//src/connectivity/bluetooth/lib/profile-client",
"//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/fuchsia-runtime",
"//src/lib/fuchsia-sync",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:bitflags",
"//third_party/rust_crates:derivative",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust",
"//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/browse_controller_service.rs",
"src/controller_service.rs",
"src/main.rs",
"src/metrics/mod.rs",
"src/packets/browsing/change_path.rs",
"src/packets/browsing/get_folder_items.rs",
"src/packets/browsing/get_item_attributes.rs",
"src/packets/browsing/get_total_items.rs",
"src/packets/browsing/mod.rs",
"src/packets/browsing/set_addressed_player.rs",
"src/packets/browsing/set_browsed_player.rs",
"src/packets/continuation.rs",
"src/packets/get_capabilities.rs",
"src/packets/get_element_attributes.rs",
"src/packets/get_play_status.rs",
"src/packets/inform_battery_status.rs",
"src/packets/mod.rs",
"src/packets/notification.rs",
"src/packets/play_item.rs",
"src/packets/player_application_settings/get_attribute_text.rs",
"src/packets/player_application_settings/get_current_settings.rs",
"src/packets/player_application_settings/get_value_text.rs",
"src/packets/player_application_settings/list_settings.rs",
"src/packets/player_application_settings/mod.rs",
"src/packets/player_application_settings/set_current_settings.rs",
"src/packets/rejected.rs",
"src/packets/set_absolute_volume.rs",
"src/peer/controller.rs",
"src/peer/handlers/browse_channel.rs",
"src/peer/handlers/decoders.rs",
"src/peer/handlers/mod.rs",
"src/peer/inspect.rs",
"src/peer/mod.rs",
"src/peer/tasks/mod.rs",
"src/peer/tasks/notification_stream.rs",
"src/peer_manager/inspect.rs",
"src/peer_manager/mod.rs",
"src/peer_manager/target_delegate.rs",
"src/profile.rs",
"src/service.rs",
"src/types.rs",
]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_component("component") {
component_name = "bt-avrcp"
manifest = "meta/bt-avrcp.cml"
deps = [ ":bin" ]
}
fuchsia_package("bt-avrcp") {
deps = [ ":component" ]
}
# The core realm shard to be used by product integrators.
core_shard("bt-avrcp-core-shard") {
shard_file = "meta/bt-avrcp.core_shard.cml"
}
fuchsia_unittest_package("bt-avrcp-tests") {
# tests various errors connecting to a peer and produces error logs
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
deps = [ ":bin_test" ]
}
group("tests") {
testonly = true
deps = [ ":bt-avrcp-tests" ]
}