blob: b401930895b943d10649a2de16b871b91f0e3d85 [file]
# Copyright 2026 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.
load(
"//build/bazel/rules/components:fx_component.bzl",
"fx_component",
"fx_component_manifest",
)
load(
"//build/bazel/rules/components:structured_config.bzl",
"fuchsia_structured_config_rust_lib",
)
load(
"//build/bazel/rules/packages:fx_packaged_binary.bzl",
"fx_packaged_binary",
)
load("//build/bazel/rules/rust:rustc_binary.bzl", "rustc_binary")
load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library")
load("//build/bazel/rules/rust:rustc_test.bzl", "rustc_test")
load(
"//build/bazel/rules/testing:fx_unittest_package.bzl",
"fx_unittest_package",
)
package(default_applicable_licenses = ["//:license"])
test_suite(
name = "tests",
tests = [":fdomain-uart-driver-tests"],
visibility = ["//src/developer:__pkg__"],
)
rustc_library(
name = "lib",
srcs = [
"src/coordinator.rs",
"src/error.rs",
"src/lib.rs",
"src/receiver.rs",
"src/sender.rs",
"src/serial.rs",
],
crate_name = "fdomain_uart_driver_lib",
edition = "2024",
deps = [
":fdomain_uart_driver_config",
"//sdk/fidl/fuchsia.hardware.serial:fuchsia.hardware.serial_rust",
"//src/developer/lib/uart_fpl",
"//src/developer/remote-control/fidl:fuchsia.developer.remotecontrol.connector_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates/vendor:futures",
"//third_party/rust_crates/vendor:log",
"//third_party/rust_crates/vendor:thiserror",
],
)
rustc_test(
name = "fdomain_uart_driver_lib_test",
crate = ":lib",
tags = ["manual"],
target_compatible_with = ["@platforms//os:fuchsia"],
deps = [
"//src/lib/fuchsia",
],
)
rustc_binary(
name = "bin",
srcs = ["src/main.rs"],
binary_name = "fdomain_uart_driver",
edition = "2024",
deps = [
":lib",
"//src/lib/fuchsia",
],
)
fx_component_manifest(
name = "manifest",
component_name = "fdomain-uart-driver",
includes = ["//sdk/lib/syslog:client.shard"],
manifest = "meta/fdomain_uart_driver.cml",
)
fuchsia_structured_config_rust_lib(
name = "fdomain_uart_driver_config",
cm_label = ":manifest",
)
fx_packaged_binary(
name = "fdomain_uart_driver_packaged_bin",
binary = ":bin",
binary_name = "fdomain_uart_driver",
)
fx_component(
name = "component",
compiled_manifest = ":manifest",
visibility = ["//src/developer/remote-control:__pkg__"],
deps = [":fdomain_uart_driver_packaged_bin"],
)
fx_unittest_package(
name = "fdomain-uart-driver-tests",
max_log_severity = "ERROR",
unit_tests = [":fdomain_uart_driver_lib_test"],
)