| # Copyright 2022 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") |
| |
| assert(is_host, "ffx_command is for use with the host toolchain only") |
| |
| rustc_library("lib") { |
| name = "ffx_command" |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| |
| visibility = [ |
| ":*", |
| "//src/developer/ffx/frontends/*", |
| "//src/developer/ffx/tools/usb_driver:*", |
| |
| # TODO(b/386792198) Move ToolSuite to internal crate. |
| "//src/developer/ffx/lib/fho:*", |
| |
| # TODO(b/287862487) TestEnv should be refactored |
| # to be more like FhoEnv |
| "//src/developer/ffx/lib/fho/testing:*", |
| |
| # Necessary for checking if enhanced analytics is enabled. |
| "//src/developer/ffx/lib/diagnostics/*", |
| |
| # E2E tests that parse the JSON ArgsInfo |
| "//src/developer/ffx/tests/cli-goldens:*", |
| "//src/developer/ffx/tests/help-json:*", |
| |
| # Reference doc generation based on JSON |
| "//tools/clidoc:*", |
| |
| # Ability to call subcommands from doctor |
| "//src/developer/ffx/plugins/doctor:*", |
| |
| # ffx-target-list depends on the FfxCommandLine directly |
| "//src/developer/ffx/plugins/target/list:*", |
| ] |
| |
| 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:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:camino", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:schemars", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| sources = [ |
| "src/args_info.rs", |
| "src/describe.rs", |
| "src/ffx.rs", |
| "src/lib.rs", |
| "src/metrics.rs", |
| "src/subcommand.rs", |
| "src/tools.rs", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":lib_test", |
| "error:tests", |
| ] |
| } |