| # 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/components.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| |
| executable("bin") { |
| output_name = "build_info" |
| sources = [ |
| "build_info.cc", |
| "build_info.h", |
| "main.cc", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.buildinfo", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fsl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_component("build-info") { |
| manifest = "meta/build_info.cml" |
| deps = [ ":bin" ] |
| } |
| |
| # TODO(fxbug.dev/81009): delete the below |
| fuchsia_component("build-info-legacy") { |
| component_name = "build-info" |
| manifest = "meta/build_info.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("build-info-service") { |
| deps = [ |
| ":build-info", |
| ":build-info-legacy", |
| ] |
| } |
| |
| core_shard("build_info_core_shard") { |
| shard_file = "meta/build_info.core_shard.cml" |
| } |
| |
| executable("test-bin") { |
| testonly = true |
| output_name = "build_info_unittest" |
| sources = [ |
| "build_info.cc", |
| "build_info.h", |
| "build_info_unittest.cc", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.buildinfo", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| } |
| |
| fuchsia_unittest_package("build-info-unittest") { |
| deps = [ ":test-bin" ] |
| test_specs = { |
| # Tests may produce ERROR logs when validating behavior in scenarios where |
| # build-info is not present (e.g. not allowlisted). |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":build-info-unittest" ] |
| } |