| # 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. |
| |
| # This file was generated by the `fx create` command. The template |
| # is located at `//tools/create/templates/component-default/BUILD.gn.tmpl-rust`. |
| # If you find something broken, we are eager to review fixes. |
| |
| import("//build/components.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| group("broker") { |
| deps = [ ":package" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":power-broker-unittests", |
| "tests/integration:tests", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| output_name = "power-broker" |
| edition = "2021" |
| |
| # Generates a GN target for unit-tests with the label `bin_test`, and |
| # a binary named `power_broker_bin_test`. |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.power.broker:fuchsia.power.broker_rust", |
| "//src/lib/async-utils", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:tracing", |
| "//third_party/rust_crates:uuid", |
| ] |
| |
| test_deps = [ |
| "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", |
| "//src/power/broker/client", |
| "//third_party/rust_crates:lazy_static", |
| ] |
| |
| sources = [ |
| "src/broker.rs", |
| "src/credentials.rs", |
| "src/main.rs", |
| "src/topology.rs", |
| ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "power-broker" |
| manifest = "meta/power_broker.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("package") { |
| package_name = "power-broker" |
| deps = [ ":component" ] |
| } |
| |
| # Run with `fx test power-broker-unittests`. |
| fuchsia_unittest_package("power-broker-unittests") { |
| deps = [ ":bin_test" ] |
| } |