blob: e455bb31b1c0e416a974076d67e91d907446afa3 [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 = "2021"
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") {
deps = [ ":component_id_index_test" ]
test_specs = {
}
}
group("tests") {
testonly = true
deps = [ ":component-id-index-tests" ]
}