| # Copyright 2023 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_binary.gni") |
| |
| rustc_binary("bin") { |
| edition = "2021" |
| output_name = "config_from_parent_example_rust" |
| sources = [ "src/main.rs" ] |
| deps = [ |
| ":example_config", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:tracing", |
| ] |
| } |
| |
| fuchsia_component_manifest("manifest") { |
| component_name = "config_example" |
| manifest = "meta/config_example.cml" |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":manifest" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_structured_config_rust_lib("example_config") { |
| cm_label = ":manifest" |
| } |
| |
| fuchsia_structured_config_values("values_from_gn") { |
| cm_label = ":manifest" |
| values = { |
| greeting = "World" |
| } |
| } |
| |
| fuchsia_structured_config_values("values_from_json_file") { |
| cm_label = ":manifest" |
| values_source = "../config_example_default_values.json5" |
| } |
| |
| fuchsia_package("rust_config_from_parent_example") { |
| deps = [ |
| ":component", |
| ":values_from_gn", |
| ] |
| } |
| |
| group("rust") { |
| deps = [ ":rust_config_from_parent_example" ] |
| } |