blob: c751bdb1344eef072f990b4eaf8dc5ca95975c5d [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/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS")
load("//build/bazel/rules/host_tests:host_rustc_test.bzl", "host_rustc_test")
load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library")
load("//src/developer/ffx/build:ffx_tool.bzl", "ffx_tool")
package(default_applicable_licenses = ["//:license"])
test_suite(
name = "host_tests",
target_compatible_with = HOST_OS_CONSTRAINTS,
tests = [":ffx_tool_agent_lib_test"],
visibility = ["//src/developer/ffx:__pkg__"],
)
rustc_library(
name = "lib",
srcs = [
"src/args.rs",
"src/lib.rs",
"src/tests.rs",
],
crate_name = "ffx_tool_agent",
edition = "2024",
target_compatible_with = HOST_OS_CONSTRAINTS,
deps = [
"//src/developer/ffx/config:lib",
"//src/developer/ffx/lib/agent:lib",
"//src/developer/ffx/lib/discovery:lib",
"//src/developer/ffx/lib/fho:lib",
"//src/developer/ffx/lib/writer:lib",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:schemars",
"//third_party/rust_crates/vendor:serde",
],
)
# LINT.IfChange
ffx_tool(
name = "ffx_agent",
srcs = ["src/main.rs"],
binary_name = "ffx-agent",
edition = "2024",
target_compatible_with = HOST_OS_CONSTRAINTS,
deps = [
":lib",
"//src/developer/ffx/lib/fho:lib",
"//src/lib/fuchsia-async",
],
)
# LINT.ThenChange(BUILD.gn)
host_rustc_test(
name = "ffx_tool_agent_lib_test",
crate = ":lib",
deps = [
"//src/lib/fuchsia",
"//third_party/rust_crates/vendor:pretty_assertions",
"//third_party/rust_crates/vendor:serde_json",
"//third_party/rust_crates/vendor:tempfile",
],
)