| # 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/fidl:fidl_library.bzl", "fidl_library") | |
| load("//build/bazel/rules/host_tests:host_rustc_test.bzl", "wrap_host_rust_test") | |
| load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library") | |
| load("//build/bazel/rules/rust:rustc_test.bzl", "rustc_test") | |
| load("//build/bazel/rules/testing:fx_unittest_package.bzl", "fx_unittest_package") | |
| package(default_applicable_licenses = ["//:license"]) | |
| rustc_library( | |
| name = "config_encoder", | |
| srcs = ["src/lib.rs"], | |
| edition = "2024", | |
| visibility = [ | |
| "//src/lib/assembly/structured_config:__pkg__", | |
| "//src/lib/fuchsia-component-test/realm_builder_server:__pkg__", | |
| "//src/security:__subpackages__", | |
| "//src/sys/component_manager:__subpackages__", | |
| "//tools/configc:__pkg__", | |
| "//tools/lib/cm_fidl_analyzer:__subpackages__", | |
| ], | |
| deps = [ | |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust_common", | |
| "//src/lib/dynfidl/rust:dynfidl", # @bazel2gn:path_overwrite://src/lib/dynfidl/rust | |
| "//src/sys/lib/cm_rust", | |
| "//third_party/rust_crates/vendor:flyweights", | |
| "//third_party/rust_crates/vendor:thiserror", | |
| ], | |
| ) | |
| fidl_library( | |
| name = "test.config.encoder", | |
| testonly = True, | |
| srcs = ["fidl/config_encoder.test.fidl"], | |
| ) | |
| rustc_test( | |
| name = "config_encoder_test", | |
| crate = ":config_encoder", | |
| edition = "2024", | |
| deps = [ | |
| ":test.config.encoder_rust_common", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/sys/lib/fidl_fuchsia_component_config_ext", | |
| ], | |
| ) | |
| wrap_host_rust_test( | |
| name = "config_encoder_host_test", | |
| binary_name = "config_encoder_test", | |
| ) | |
| fx_unittest_package( | |
| name = "config_encoder_tests", | |
| unit_tests = [":config_encoder_test"], | |
| ) |