blob: 278c850fb54c4d2652f8a0524732d4ce3eb90a5b [file] [edit]
# 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("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS")
load("//build/bazel/rules/rust:defs.bzl", "rustc_library")
rustc_library(
name = "lib",
srcs = [
"src/args_info.rs",
"src/describe.rs",
"src/ffx.rs",
"src/lib.rs",
"src/metrics.rs",
"src/subcommand.rs",
"src/tools.rs",
],
crate_name = "ffx_command",
edition = "2024",
proc_macro_deps = [
"//third_party/rust_crates/vendor:async-trait",
],
target_compatible_with = HOST_CONSTRAINTS,
test_deps = [
"//src/lib/fuchsia",
"//third_party/rust_crates/vendor:assert_matches",
"//third_party/rust_crates/vendor:tempfile",
],
version = "0.1.0",
visibility = [
":__pkg__",
"//src/developer/ffx/frontends:__subpackages__",
"//src/developer/ffx/tools/usb_driver:__pkg__",
# TODO(b/386792198) Move ToolSuite to internal crate.
"//src/developer/ffx/lib/fho:__pkg__",
# TODO(b/287862487) TestEnv should be refactored
# to be more like FhoEnv
"//src/developer/ffx/lib/fho/testing:__pkg__",
# Necessary for checking if enhanced analytics is enabled.
"//src/developer/ffx/lib/diagnostics:__subpackages__",
# E2E tests that parse the JSON ArgsInfo
"//src/developer/ffx/tests/cli-goldens:__pkg__",
"//src/developer/ffx/tests/help-json:__pkg__",
# Reference doc generation based on JSON
"//tools/clidoc:__pkg__",
# Ability to call subcommands from doctor
"//src/developer/ffx/plugins/doctor:__pkg__",
# ffx-target-list depends on the FfxCommandLine directly
"//src/developer/ffx/plugins/target/list:__pkg__",
# ffx-target-ssh explicitly specifies the exit code
"//src/developer/ffx/plugins/target/ssh:__pkg__",
# completion plugin needs to build the command struct from json
"//src/developer/ffx/plugins/completion:__pkg__",
],
with_host_unit_tests = True,
deps = [
"//src/developer/ffx/command/error:lib",
"//src/developer/ffx/config:lib",
"//src/developer/ffx/lib/errors:lib",
"//src/developer/ffx/lib/fho/metadata:lib",
"//src/developer/ffx/lib/metrics:lib",
"//src/developer/ffx/lib/netext:lib",
"//src/developer/ffx/lib/timeout:lib",
"//src/developer/lib/writer:lib",
"//src/lib/analytics/rust:lib",
"//src/lib/fuchsia-async",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:camino",
"//third_party/rust_crates/vendor:itertools",
"//third_party/rust_crates/vendor:log",
"//third_party/rust_crates/vendor:regex",
"//third_party/rust_crates/vendor:schemars",
"//third_party/rust_crates/vendor:serde",
"//third_party/rust_crates/vendor:serde_json",
"//third_party/rust_crates/vendor:thiserror",
],
)