| # Copyright 2019 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/fidl/fidl.gni") |
| import("//build/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| package("component_index") { |
| testonly = true |
| |
| deps = [ |
| ":component_index_bin", |
| "//build/images:component_index_metadata", |
| ] |
| |
| binaries = [ |
| { |
| name = "component_index" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/component_index.cmx") |
| dest = "component_index.cmx" |
| }, |
| ] |
| |
| resources = [ |
| { |
| path = get_label_info("//build/images:component_index_metadata", |
| "target_out_dir") + "/component_index_metadata" |
| dest = "component_index.txt" |
| }, |
| ] |
| } |
| |
| rustc_binary("component_index_bin") { |
| name = "component_index" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/component_index/fidl:index-rustc", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| } |
| |
| test_package("component_index_tests") { |
| deps = [ ":component_index_bin_test" ] |
| |
| tests = [ |
| { |
| name = "component_index_bin_test" |
| dest = "component_index_tests" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":component_index_tests" ] |
| } |