| # Copyright 2021 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/config.gni") |
| |
| # The list of Sampler configuration files in the current directory that |
| # are used to configure data to be sent to Cobalt. Files that are not listed |
| # in this variable will be ignored. |
| sampler_files = [ |
| "audio-drivers.json", |
| "archivist.json", |
| "avrcp.json", |
| "bthost.json", |
| "display.json", |
| "file-usage-metrics.json", |
| "ftl.json", |
| "fshost.json", |
| "fvm.json", |
| "input.json", |
| "netstack.json", |
| "radar.json", |
| "sdmmc.json", |
| "setui.json", |
| "sysmem.json", |
| "system-update-committer.json", |
| "connectivity-wlan.json", |
| ] |
| |
| # Install Sampler and FIRE config into the "sampler" package |
| |
| config_data("sampler_config_internal") { |
| for_pkg = "sampler" |
| sources = sampler_files |
| |
| # The component will see this as /config/metrics/fuchsia/foo.json |
| outputs = [ "metrics/fuchsia/{{source_file_part}}" ] |
| } |
| |
| group("sampler-config-data") { |
| deps = [ |
| ":sampler_config_internal", |
| "//src/diagnostics/config/fire:fire_config_data", |
| ] |
| } |
| |
| # Validate Sampler config |
| |
| resource("sampler-validation-resources") { |
| sources = sampler_files |
| |
| # The component will see this as /pkg/config/fuchsia/metrics/foo.json |
| outputs = [ "config/metrics/fuchsia/{{source_file_part}}" ] |
| } |
| |
| # Test component for config validation. |
| fuchsia_unittest_component("config-validation-component") { |
| deps = [ |
| ":sampler-validation-resources", |
| "//src/diagnostics/sampler/tests:config-validation", |
| ] |
| } |
| |
| # This target name must be unique in the build tree |
| fuchsia_test_package("sampler-config-validation-package-src-diagnostics") { |
| test_components = [ ":config-validation-component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":sampler-config-validation-package-src-diagnostics" ] |
| } |