| # Copyright 2019 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/host.gni") |
| import("//build/sdk/sdk_host_tool.gni") |
| import("//build/testing/host_test.gni") |
| import("./build/ffx.gni") |
| |
| group("ffx") { |
| testonly = true |
| |
| public_deps = [ |
| ":ffx_tool", |
| ":tests", |
| "lib", |
| ] |
| } |
| |
| if (is_host) { |
| ffx("ffx") { |
| version = "0.1.0" |
| edition = "2018" |
| with_unit_tests = true |
| |
| plugin_deps = [ |
| "//src/developer/ffx/plugins/assembly:ffx_assembly", |
| "//src/developer/ffx/plugins/component:ffx_component", |
| "//src/developer/ffx/plugins/config:ffx_config_plugin", |
| "//src/developer/ffx/plugins/daemon:ffx_daemon_plugin", |
| "//src/developer/ffx/plugins/doctor:ffx_doctor", |
| "//src/developer/ffx/plugins/emulator:ffx_emulator", |
| "//src/developer/ffx/plugins/overnet:ffx_overnet_plugin", |
| "//src/developer/ffx/plugins/packaging:ffx_packaging", |
| "//src/developer/ffx/plugins/platform:ffx_platform", |
| "//src/developer/ffx/plugins/repository:ffx_repository", |
| "//src/developer/ffx/plugins/scrutiny:ffx_scrutiny", |
| "//src/developer/ffx/plugins/sdk:ffx_sdk", |
| "//src/developer/ffx/plugins/self-test:ffx_selftest", |
| "//src/developer/ffx/plugins/session:ffx_session", |
| "//src/developer/ffx/plugins/starnix:ffx_starnix", |
| "//src/developer/ffx/plugins/target:ffx_target", |
| "//src/developer/ffx/plugins/trace:ffx_trace", |
| "//src/developer/ffx/plugins/version:ffx_version", |
| "//src/developer/ffx/plugins/zxdb:ffx_zxdb_plugin", |
| ] |
| |
| sources = [ |
| "src/args.rs", |
| "src/lib.rs", |
| "src/main.rs", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.developer.bridge:fuchsia.developer.bridge-rustc", |
| "//sdk/fidl/fuchsia.overnet:fuchsia.overnet-rustc", |
| "//src/connectivity/overnet/lib/ascendd", |
| "//third_party/rust_crates:async-lock", |
| "//third_party/rust_crates:tempfile", |
| ] |
| } |
| |
| sdk_host_tool("bin_sdk") { |
| # TODO(fxbug.dev/57313): partner only at this time while we shake |
| # out alpha bugs and fill-in docs, etc. |
| category = "partner" |
| output_name = "ffx" |
| |
| deps = [ ":ffx_bin" ] |
| } |
| |
| host_test("ffx-e2e-without-target") { |
| binary_path = "$root_out_dir/ffx" |
| args = [ |
| "self-test", |
| "--include-target", |
| "false", |
| ] |
| |
| deps = [ ":ffx_bin" ] |
| |
| # TODO(65933): re-enable on Mac once flake issues are resolved. |
| environments = [ linux_env ] |
| } |
| |
| host_test("ffx-e2e-with-target") { |
| binary_path = "$root_out_dir/ffx" |
| args = [ "self-test" ] |
| |
| deps = [ ":ffx_bin" ] |
| |
| # TODO(fxbug.dev/60683): split additional dimensions such as multi-device |
| # mac + device, etc. |
| environments = [ |
| # XXX(fxbug.dev/64897): support arm64 HTI tests |
| # emu_env, |
| nuc_env, |
| ] |
| } |
| } |
| |
| install_host_tools("host") { |
| deps = [ ":ffx_bin" ] |
| outputs = [ "ffx" ] |
| } |
| |
| group("ffx_tool") { |
| deps = [ |
| ":ffx_bin($host_toolchain)", |
| ":host", |
| ] |
| } |
| |
| group("runtime") { |
| deps = [ |
| # The tool |
| ":host", |
| |
| # Target-side dependencies |
| "//src/developer/remote-control:runtime", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ffx-e2e-with-target($host_toolchain)", |
| ":ffx-e2e-without-target($host_toolchain)", |
| ":ffx_tests($host_toolchain)", |
| "lib:tests($host_toolchain)", |
| "//src/developer/ffx/logger:tests($host_toolchain)", |
| ] |
| } |