blob: 70803a4815bb958f9bd0844ebd8616a15d5c4218 [file]
# Copyright 2025 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/sdk/sdk_atom.gni")
import("//build/testing/host_test_data.gni")
import("//src/developer/ffx/build/ffx_tool.gni")
if (is_host) {
# When used in the build, this separate subtool version is used to avoid
# its build steps depending on all of ffx. In order to use it with ffx_action,
# you need to tell it to use the versioned executable target as follows:
#
# ffx_tool =
# "//src/developer/ffx/plugins/product_bundle:ffx_product_bundle_tool"
# ffx_tool_output_name = "ffx-product-bundle"
# LINT.IfChange(ffx_product_bundle_tool)
bazel_ffx_tool("ffx_product_bundle_tool") {
output_name = "ffx-product-bundle"
sdk_category = "partner"
}
# LINT.ThenChange(//src/developer/ffx/plugins/product_bundle/BUILD.bazel:ffx_product_bundle_tool)
host_test_data("ffx_product_bundle_tool_test_data") {
visibility = [
"//src/developer/ffx:*",
"//src/sys/pkg/tests/system-tests:*",
]
data_deps = [ ":ffx_product_bundle_tool_host_tool" ]
sources = [
"${host_tools_dir}/ffx-product-bundle",
"${host_tools_dir}/ffx-product-bundle.json",
]
}
group("product_bundle") {
public_deps = [
":ffx_product_bundle_tool",
":ffx_product_bundle_tool_host_tool",
]
}
group("bin") {
public_deps = [ ":ffx_product_bundle_tool_versioned" ]
}
# TODO(https://fxbug.dev/438572714): Remove once the IDK uses the Bazel atom.
_idk_path = "tools/$current_cpu/ffx_tools/ffx-product-bundle"
sdk_atom("sdk") {
category = "partner"
sdk_area = "Developer"
id = "sdk://$_idk_path"
idk_name = "ffx-product-bundle"
meta = {
dest = "$_idk_path-meta.json"
type = "ffx_tool"
source_prebuild_info = {
arch = current_cpu
file_base = "tools"
}
}
files = [
{
source = "$root_out_dir/ffx-product-bundle"
dest = _idk_path
},
{
source = "$root_out_dir/ffx-product-bundle.json"
dest = "$_idk_path.json"
},
]
non_sdk_deps = [ ":ffx_product_bundle_tool_versioned" ]
}
}
group("tests") {
testonly = true
deps = [
":ffx_product_bundle_tests($host_toolchain)",
# Plugins migrated to Bazel define standalone unit test targets that are not
# aggregated by `:ffx_product_bundle_tests`.
"create:tests",
]
}
## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ##
#
# ________ _________ ________ ________
# |\ ____\|\___ ___\\ __ \|\ __ \
# \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \
# \ \_____ \ \ \ \ \ \ \\\ \ \ ____\
# \|____|\ \ \ \ \ \ \ \\\ \ \ \___|
# ____\_\ \ \ \__\ \ \_______\ \__\
# |\_________\ \|__| \|_______|\|__|
# \|_________|
#
#
# AUTO-GENERATED - DO NOT EDIT
#
# The targets below are auto-generated based on the targets defined in the
# BUILD.bazel file from the same directory. If you made changes to targets in
# Bazel, instead of editing this file manually, run:
#
# > fx bazel2gn
#
# Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and
# rerun bazel2gn.
import("//build/tools/bazel2gn/bazel_migration.gni")
ffx_plugin("ffx_product_bundle") {
args_deps = [
"//src/developer/ffx/core:lib",
"//third_party/rust_crates:argh",
]
args_sources = [ "src/args.rs" ]
edition = "2024"
plugin_deps = [
"//src/developer/ffx/plugins/product_bundle/bisect:ffx_product_bundle_bisect",
"//src/developer/ffx/plugins/product_bundle/create:ffx_product_bundle_create",
]
sdk_category = "partner"
version = "0.1.0"
visibility = [
":*",
"//src/developer/ffx/frontends/ffx:*",
]
}