| # Copyright 2026 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. | |
| load( | |
| "//build/bazel/rules/components:fx_component.bzl", | |
| "fx_component_manifest", | |
| "fx_test_component", | |
| ) | |
| load("//build/bazel/rules/packages:fx_package.bzl", "fx_package") | |
| load("//build/bazel/rules/packages:fx_packaged_binary.bzl", "fx_packaged_binary") | |
| load("//build/bazel/rules/rust:defs.bzl", "rustc_library") | |
| load("//build/bazel/rules/testing:fx_test.bzl", "fx_test") | |
| package(default_applicable_licenses = ["//:license"]) | |
| rustc_library( | |
| name = "runtime", | |
| srcs = ["src/lib.rs"], | |
| crate_name = "fuchsia_component_runtime", | |
| edition = "2024", | |
| test_deps = [ | |
| "//src/lib/fuchsia", | |
| "//src/lib/fuchsia-async", | |
| "//third_party/rust_crates/vendor:assert_matches", | |
| ], | |
| visibility = ["//src/lib/fuchsia-component:__subpackages__"], | |
| with_unit_tests = True, | |
| deps = [ | |
| "//sdk/fidl/fuchsia.component.runtime:fuchsia.component.runtime_rust", | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | |
| "//sdk/rust/zx", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia-component/client", | |
| "//third_party/rust_crates/vendor:futures", | |
| ], | |
| ) | |
| fx_packaged_binary( | |
| name = "runtime_test_packaged_bin", | |
| testonly = True, | |
| binary = ":runtime_test", | |
| binary_name = "fuchsia_component_runtime_lib_test", | |
| ) | |
| fx_component_manifest( | |
| name = "fuchsia-component-runtime-unittests-manifest", | |
| testonly = True, | |
| component_name = "fuchsia-component-runtime-unittests", | |
| includes = [ | |
| "//sdk/lib/syslog:client.shard", | |
| "//src/sys/test_runners/rust:default.shard.cml", | |
| ], | |
| manifest = "meta/fuchsia-component-runtime-unittests.cml", | |
| ) | |
| fx_test_component( | |
| name = "fuchsia-component-runtime-unittests-component", | |
| compiled_manifest = ":fuchsia-component-runtime-unittests-manifest", | |
| component_name = "fuchsia-component-runtime-unittests", | |
| deps = [":runtime_test_packaged_bin"], | |
| ) | |
| fx_package( | |
| name = "fuchsia-component-runtime-unittests-package", | |
| package_name = "fuchsia-component-runtime-unittests", | |
| test_components = [":fuchsia-component-runtime-unittests-component"], | |
| ) | |
| fx_test( | |
| name = "fuchsia-component-runtime-unittests", | |
| package = ":fuchsia-component-runtime-unittests-package", | |
| ) |