| # 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/host.gni") |
| |
| declare_args() { |
| # Build any ffx plugins that can be built either as built-in or as separate |
| # subtools as subtools. |
| # |
| # Note that if you change this and don't `fx clean` you may wind up with stale |
| # copies of either the main `ffx` binary (with all the plugins built in) or |
| # the separately compiled ones, and that might produce confusing `ffx help` |
| # or `ffx commands` output. |
| # |
| # When all subtools that will be migrated to the SDK have been migrated, |
| # this config flag will be set to true by default, deprecated, and eventually |
| # removed: https://fxbug.dev/42068537 |
| ffx_build_dual_mode_plugins_as_subtools = false |
| } |
| |
| # The path within the build where test host tools live |
| ffx_test_host_tools_out_dir = "${host_tools_dir}" |
| |
| # The list of ffx plugins that we'd expect to be included directly in the binary |
| # for architectural reasons. |
| required_ffx_plugins = [ |
| "//src/developer/ffx/plugins/config:ffx_config_plugin", |
| "//src/developer/ffx/plugins/daemon:ffx_daemon_plugin", |
| "//src/developer/ffx/plugins/target:ffx_target", |
| "//src/developer/ffx/plugins/version:ffx_version", |
| "//src/developer/ffx/plugins/platform:ffx_platform", |
| "//src/developer/ffx/plugins/sdk:ffx_sdk", |
| ] |
| |
| # The list of ffx plugins that we currently build as part of the 'main' ffx |
| # binary but that don't really have to be there. These should all be migrated |
| # to being "dual mode" subtools. |
| included_ffx_plugins = [ |
| "//src/connectivity/network/net-cli/ffx:ffx_net", |
| |
| # This is deliberately not included in the dual mode set as a policy decision |
| # to keep doctor with the main binary. We might re-evaluate that but for now |
| # this is intended to be here. |
| "//src/developer/ffx/plugins/doctor:ffx_doctor", |
| ] |
| |
| # The list of plugins that can be built either as plugins or subtools, |
| # used in the main ffx target if `ffx_build_dual_mode_plugns_as_subtools` |
| # is false, and in tools/BUILD.gn if it's true (with the suffix of |
| # `_tool_host_tool` appended) |
| dual_mode_plugins = [ |
| "//src/developer/ffx/plugins/component:ffx_component", |
| "//src/developer/ffx/plugins/debug:ffx_debug_plugin", |
| "//src/developer/ffx/plugins/emulator:ffx_emulator", |
| "//src/developer/ffx/plugins/log:ffx_log", |
| "//src/developer/ffx/plugins/package:ffx_package", |
| "//src/developer/ffx/plugins/product:ffx_product", |
| "//src/developer/ffx/plugins/repository:ffx_repository", |
| "//src/developer/ffx/plugins/session:ffx_session", |
| "//src/developer/ffx/plugins/test:ffx_test", |
| ] |
| |
| # The full set of plugins you'd expect in a 'large', fully integrated ffx |
| all_ffx_plugins = required_ffx_plugins + dual_mode_plugins |
| |
| # Config default files from tools listed above so they can be included in |
| # the build. |
| dual_mode_defaults = [ |
| "//src/developer/ffx/plugins/emulator/data/config.json", |
| "//src/developer/ffx/plugins/log/data/config.json", |
| "//src/developer/ffx/plugins/product/data/config.json", |
| "//src/developer/ffx/plugins/repository/data/config.json", |
| "//src/developer/ffx/plugins/test/data/config.json", |
| ] |
| |
| # The same list as `dual_mode_plugins`, but with the normal suffix for plugins converted to |
| # subtools. |
| dual_mode_subtools = [] |
| dual_mode_subtool_bins = [] |
| dual_mode_subtool_tests = [] |
| dual_mode_subtool_test_data = [] |
| |
| foreach(plugin, dual_mode_plugins) { |
| dual_mode_subtools += [ plugin + "_tool_host_tool" ] |
| dual_mode_subtool_bins += [ plugin + "_tool_versioned" ] |
| dual_mode_subtool_tests += [ plugin + "_tests" ] |
| dual_mode_subtool_test_data += [ plugin + "_tool_test_data" ] |
| } |