| # 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_gce_tool_lib_test"], | |
| visibility = ["//src/developer/ffx:__pkg__"], | |
| ) | |
| rustc_library( | |
| name = "lib", | |
| srcs = [ | |
| "src/args.rs", | |
| "src/lib.rs", | |
| "src/subtools/list.rs", | |
| "src/subtools/mod.rs", | |
| "src/subtools/serial.rs", | |
| "src/subtools/show.rs", | |
| "src/subtools/start.rs", | |
| "src/subtools/stop.rs", | |
| ], | |
| crate_name = "ffx_gce_tool", | |
| edition = "2024", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| deps = [ | |
| "//src/developer/ffx/config:lib", | |
| "//src/developer/ffx/lib/discovery:lib", | |
| "//src/developer/ffx/lib/fho:lib", | |
| "//src/developer/ffx/lib/gce:lib", | |
| "//src/developer/ffx/lib/pbms:lib", | |
| "//src/developer/ffx/lib/writer:lib", | |
| "//src/lib/fuchsia-async", | |
| "//third_party/rust_crates/forks/prettytable-rs:prettytable", | |
| "//third_party/rust_crates/vendor:argh", | |
| "//third_party/rust_crates/vendor:log", | |
| "//third_party/rust_crates/vendor:serde", | |
| "//third_party/rust_crates/vendor:tempfile", | |
| ], | |
| ) | |
| # LINT.IfChange(ffx_gce) | |
| ffx_tool( | |
| name = "ffx_gce", | |
| srcs = ["src/main.rs"], | |
| binary_name = "ffx-gce", | |
| edition = "2024", | |
| deps = [ | |
| ":lib", | |
| "//src/developer/ffx/lib/fho:lib", | |
| "//src/lib/fuchsia-async", | |
| ], | |
| ) | |
| # LINT.ThenChange(BUILD.gn:ffx_gce) | |
| host_rustc_test( | |
| name = "ffx_gce_tool_lib_test", | |
| crate = ":lib", | |
| deps = [ | |
| "//build/sdk/meta:rust", | |
| "//src/lib/fuchsia", | |
| "//third_party/rust_crates/vendor:serde_json", | |
| ], | |
| ) |