| # 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/product.gni") |
| import("//build/sdk/sdk_host_tool.gni") |
| import("//build/testing/host_test.gni") |
| import("//build/testing/host_test_data.gni") |
| import("//build/tools/json_merge/json_merge.gni") |
| import("//src/storage/fshost/generated_fshost_config.gni") |
| import("config.gni") |
| |
| group("ffx") { |
| testonly = true |
| |
| public_deps = [ |
| ":ffx-defaults.json($host_toolchain)", |
| ":ffx_tool", |
| ":tests", |
| "lib($host_toolchain)", |
| ] |
| } |
| |
| group("ffx_tool") { |
| deps = [ |
| ":host", |
| "frontends/ffx:ffx_bin($host_toolchain)", |
| "tools($host_toolchain)", |
| ] |
| } |
| |
| install_host_tools("host") { |
| deps = [ "frontends/ffx:ffx_bin" ] |
| outputs = [ "ffx" ] |
| } |
| |
| group("runtime") { |
| deps = [ |
| # The tool |
| ":host", |
| ] |
| } |
| |
| if (is_host) { |
| group("ffx_bin") { |
| public_deps = [ "frontends/ffx:ffx_bin" ] |
| } |
| |
| 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_data("test_data") { |
| deps = [ ":host" ] |
| sources = [ "${host_tools_dir}/ffx" ] |
| } |
| |
| group("suite_test_data") { |
| testonly = true |
| public_deps = [ ":test_data" ] |
| if (ffx_build_dual_mode_plugins_as_subtools) { |
| public_deps += dual_mode_subtool_test_data |
| } |
| } |
| |
| json_merge("ffx-defaults.json") { |
| # the "DEFAULT" config level will be made up of a json merge of the following |
| # source json, some of which may be generated. Anything that's part of an |
| # ffx_plugin() definition included under the main ffx binary will automatically |
| # be merged in by that machinery, but if it comes from an external subtool or a library |
| # it has to be manually added to this list. |
| sources = [ |
| rebase_path("//src/developer/ffx/data/config.json"), |
| rebase_path("//src/developer/ffx/daemon/data/config.json"), |
| rebase_path("//src/developer/ffx/lib/pbms/data/config.json"), |
| ] |
| |
| # Add in the 'dual-mode' config default files if we're doing dual mode |
| if (ffx_build_dual_mode_plugins_as_subtools) { |
| foreach(config, dual_mode_defaults) { |
| sources += [ rebase_path(config) ] |
| } |
| } |
| |
| # Add any dynamically generated config.json files (ie. from ffx plugin roots) here. |
| deps = [ |
| # This will bring in all built-in subtool config.json files. |
| "//src/developer/ffx/frontends/ffx:config.json($host_toolchain)", |
| ] |
| |
| foreach(dep, deps) { |
| sources += [ get_label_info(dep, "target_out_dir") + "/config.json" ] |
| } |
| } |
| } |
| |
| # NOTE: this group is included in `//src/developer:tests` and `//src:tests` which get added as |
| # dependencies of the system image in infra builds. Tests which need to depend on a system image |
| # should be added to `host_tests` below. |
| group("tests") { |
| testonly = true |
| deps = [ |
| # Driver tests |
| "frontends/ffx:tests($host_toolchain)", |
| |
| # Subtool tests |
| "tools:tests($host_toolchain)", |
| |
| # Individual library tests, for libraries that are not plugins. |
| "command:tests($host_toolchain)", |
| "config:tests($host_toolchain)", |
| "core:tests($host_toolchain)", |
| "daemon:tests($host_toolchain)", |
| "lib:tests($host_toolchain)", |
| "logger:tests($host_toolchain)", |
| "plugins/package:tests($host_toolchain)", |
| "tests($host_toolchain)", |
| ] |
| } |
| |
| # NOTE: this group is for tests which need to transitively depend on a Fuchsia system image for |
| # "e2e" testing of ffx behavior. These are included in `//buildbot/bundles/host` in order to prevent |
| # dep cycles. |
| if (is_host) { |
| group("host_tests") { |
| testonly = true |
| deps = [] |
| |
| # ffx e2e host tests have a few constraints: |
| # |
| # 1. the assembly targets don't build correctly on mac bots |
| # 2. bringup bots can't depend on the main assembly that's used for ffx e2e tests |
| # 3. the minfs-no_hardware bot doesn't launch the emulator correctly |
| if (is_linux && !use_bringup_assembly && |
| data_filesystem_format != "minfs") { |
| deps += [ |
| "lib:host_tests", |
| "plugins:host_tests", |
| ] |
| } |
| } |
| } |
| |
| if (is_fuchsia) { |
| group("package_deps_for_host_tests") { |
| testonly = true |
| deps = [ "plugins:package_deps_for_host_tests" ] |
| } |
| } |