blob: cb0cae773463e468509f466e2cf35b0177d2df29 [file] [log] [blame]
# Copyright 2021 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/host.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
rustc_library("routing") {
with_unit_tests = true
edition = "2018"
visibility = [
"//src/lib/component_hub/*",
"//src/security/scrutiny/plugins/*",
"//src/sys/component_manager/*",
"//src/sys/lib/cm_rust/testing:*",
"//src/sys/lib/routing/*",
"//src/sys/test_manager/*",
"//tools/lib/cm_fidl_analyzer/*",
]
deps = [
"//sdk/fidl/fuchsia.component:fuchsia.component-rustc",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl-rustc",
"//sdk/fidl/fuchsia.component.internal:fuchsia.component.internal-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//src/lib/error/clonable_error",
"//src/lib/fidl/rust/fidl",
"//src/lib/from-enum",
"//src/lib/zircon/rust:fuchsia-zircon-status",
"//src/sys/lib/cm_fidl_validator",
"//src/sys/lib/cm_moniker",
"//src/sys/lib/cm_rust",
"//src/sys/lib/cm_types",
"//src/sys/lib/component_id_index",
"//src/sys/lib/moniker",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:derivative",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:log",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:url",
]
sources = [
"src/capability_source.rs",
"src/collection.rs",
"src/component_id_index.rs",
"src/component_instance.rs",
"src/config.rs",
"src/environment.rs",
"src/error.rs",
"src/event.rs",
"src/lib.rs",
"src/path.rs",
"src/policy.rs",
"src/rights.rs",
"src/router.rs",
"src/walk_state.rs",
]
test_deps = [
"testing:routing_test_helpers",
"//src/lib/fuchsia",
]
# Some host tools use serde to serialize/deserialize types defined in
# this crate. This dependency is guarded in code via #[cfg(feature = "serde")]
# and #[cfg_attr(feature = "serde", ...)] to prevent serde dependencies in
# non-host builds.
features = []
if (is_host) {
features += [ "serde" ]
deps += [ "//third_party/rust_crates:serde" ]
test_deps += [ "//third_party/rust_crates:serde_json" ]
}
}
fuchsia_unittest_package("fuchsia-routing-tests") {
deps = [
":routing_test",
"//src/sys/test_runners:tmp_storage",
]
}
group("host-routing-tests") {
testonly = true
public_deps = [ ":routing_test($host_toolchain)" ]
}