| # Copyright 2020 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("//build/tools/json_merge/json_merge.gni") | |
| import("//src/developer/ffx/build/ffx_tool.gni") | |
| if (is_host) { | |
| json_merge("config.json") { | |
| sources = [ "data/config.json" ] | |
| minify = true | |
| } | |
| bazel_ffx_tool("ffx_trace_tool") { | |
| output_name = "ffx-trace" | |
| sdk_category = "partner" | |
| } | |
| group("trace") { | |
| public_deps = [ | |
| ":ffx_trace_tool", | |
| ":ffx_trace_tool_host_tool", | |
| ] | |
| } | |
| group("bin") { | |
| public_deps = [ ":ffx_trace_tool_versioned" ] | |
| } | |
| # Needed for Honeydew's SDK inclusion | |
| # | |
| # TODO(b/330934833): Remove when IDK allows for `testonly` targets in dep | |
| # tree or when we can separate the concept of data_dep from host_test_data. | |
| host_test_data("ffx_trace_tool_test_data") { | |
| testonly = false | |
| visibility = [ | |
| "//sdk/ctf/*", | |
| "//src/performance/memory/attribution/monitor/tests/e2e:*", | |
| "//src/testing/end_to_end/honeydew:*", | |
| "//vendor/google/*", | |
| ] | |
| data_deps = [ ":ffx_trace_tool_host_tool" ] | |
| sources = [ | |
| "${host_tools_dir}/ffx-trace", | |
| "${host_tools_dir}/ffx-trace.json", | |
| ] | |
| } | |
| # TODO(https://fxbug.dev/438572714): Remove once the IDK uses the Bazel atom. | |
| _idk_path = "tools/$current_cpu/ffx_tools/ffx-trace" | |
| sdk_atom("sdk") { | |
| category = "partner" | |
| sdk_area = "Developer" | |
| id = "sdk://$_idk_path" | |
| idk_name = "ffx-trace" | |
| meta = { | |
| dest = "$_idk_path-meta.json" | |
| type = "ffx_tool" | |
| source_prebuild_info = { | |
| arch = current_cpu | |
| file_base = "tools" | |
| } | |
| } | |
| files = [ | |
| { | |
| source = "$root_out_dir/ffx-trace" | |
| dest = _idk_path | |
| }, | |
| { | |
| source = "$root_out_dir/ffx-trace.json" | |
| dest = "$_idk_path.json" | |
| }, | |
| ] | |
| non_sdk_deps = [ ":ffx_trace_tool_versioned" ] | |
| } | |
| } |