| # 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/rust/rustc_library.gni") |
| import("//src/developer/ffx/build/ffx_tool.gni") |
| |
| rustc_library("lib") { |
| name = "ffx_usb" |
| edition = "2024" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust_fdomain", |
| "//sdk/fidl/fuchsia.diagnostics.host:fuchsia.diagnostics.host_rust_fdomain", |
| "//sdk/fidl/fuchsia.hardware.usb.policy:fuchsia.hardware.usb.policy_rust_fdomain", |
| "//sdk/fidl/fuchsia.usb.policy:fuchsia.usb.policy_rust_fdomain", |
| "//src/developer/ffx/lib/fho:lib", |
| "//src/developer/ffx/lib/rcs:lib", |
| "//src/developer/ffx/lib/target/holders:lib", |
| "//src/developer/ffx/lib/writer:lib", |
| "//src/lib/fdomain/client", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| ] |
| |
| sources = [ |
| "src/args.rs", |
| "src/diagnostics/mod.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| ffx_tool("ffx_usb") { |
| edition = "2024" |
| output_name = "ffx-usb" |
| deps = [ |
| ":lib", |
| "//src/developer/ffx/lib/fho:lib", |
| "//src/lib/fuchsia-async", |
| ] |
| sources = [ "src/main.rs" ] |
| } |
| |
| group("usb") { |
| public_deps = [ |
| ":ffx_usb", |
| ":ffx_usb_host_tool", |
| ] |
| } |
| |
| group("bin") { |
| public_deps = [ ":ffx_usb_versioned" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":lib_test($host_toolchain)" ] |
| } |