blob: 898fe44ecc3b41a3e45a5736089fce2f3085caf4 [file] [log] [blame]
# 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/dev.gni")
import("//build/fidl/fidl.gni")
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
package("component_index") {
testonly = fuchsia_zbi_testonly
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_deps = [ "//third_party/rust_crates:matches" ]
sources = [ "src/main.rs" ]
}
test_package("component_index_tests") {
deps = [ ":component_index_bin_test" ]
tests = [
{
name = "component_index_bin_test"
dest = "component_index_tests"
},
]
}
group("tests") {
testonly = true
deps = [ ":component_index_tests" ]
}