blob: 6c0d65d3eac77e311525b37b84c22fc399487de9 [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.
import("//build/host.gni")
import("//build/rust/rustc_library.gni")
import("//src/developer/ffx/build/ffx_tool.gni")
if (is_host) {
rustc_library("lib") {
name = "ffx_tool_uart"
edition = "2024"
with_unit_tests = true
deps = [
"//src/developer/ffx/config:lib",
"//src/developer/ffx/lib/fho:lib",
"//src/developer/ffx/lib/safe_string:lib",
"//src/developer/ffx/lib/target:lib",
"//src/developer/ffx/lib/uart_driver_api:lib",
"//src/developer/ffx/lib/writer:lib",
"//src/developer/lib/uart_fpl",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:log",
"//third_party/rust_crates:nix",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:schemars",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:sha2",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tokio",
]
test_deps = [
"//src/developer/ffx/config:lib",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:hex",
]
sources = [
"src/args.rs",
"src/driver.rs",
"src/lib.rs",
"src/metadata.rs",
"src/stream.rs",
"src/subtools/connect.rs",
"src/subtools/disconnect.rs",
"src/subtools/list.rs",
"src/subtools/mod.rs",
"src/subtools/probe.rs",
"src/subtools/status.rs",
"src/sys.rs",
"src/tests.rs",
]
inputs = [ "test_data/mock_driver.py" ]
}
ffx_tool("ffx_uart") {
edition = "2024"
output_name = "ffx-uart"
deps = [
":lib",
"//src/developer/ffx/lib/fho:lib",
"//src/lib/fuchsia-async",
]
data_deps =
[ "//src/developer/ffx/tools/uart_driver:ffx_uart_driver_host_tool" ]
sources = [ "src/main.rs" ]
}
group("uart") {
public_deps = [
":ffx_uart",
":ffx_uart_host_tool",
]
}
group("bin") {
public_deps = [ ":ffx_uart_versioned" ]
}
group("tests") {
testonly = true
deps = [ ":lib_test" ]
}
} else {
group("tests") {
testonly = true
deps = [ ":tests($host_toolchain)" ]
}
}