blob: f0870af914b211082d8b4f72d1dcb5847ee95449 [file] [log] [blame]
# 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("//build/rust/rustc_library.gni")
rustc_library("component_id_index") {
with_unit_tests = true
edition = "2018"
deps = [
"//sdk/fidl/fuchsia.component:fuchsia.component-rustc",
"//sdk/fidl/fuchsia.component.internal:fuchsia.component.internal-rustc",
"//src/sys/lib/moniker",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:thiserror",
]
# Some host tools use serde to serialize/deserialize component_id_index
# error types. This dependency is guarded in code via #[cfg(feature = "serde")] and
# #[cfg_attr(feature = "serde", ...)] to avoid deriving serde traits for error
# types for non-host builds.
features = []
if (is_host) {
features += [ "serde" ]
}
test_deps = [
"//third_party/rust_crates:proptest",
"//third_party/rust_crates:serde_json",
]
sources = [
"src/fidl_convert.rs",
"src/lib.rs",
]
}
fuchsia_unittest_package("component-id-index-tests") {
manifest = "meta/component-id-index-tests.cmx"
deps = [ ":component_id_index_test" ]
test_specs = {
}
}
group("tests") {
testonly = true
deps = [ ":component-id-index-tests" ]
}