| # Copyright 2020 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/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_binary("battery_cli_bin") { |
| name = "battery_cli" |
| with_unit_tests = true |
| edition = "2018" |
| deps = [ |
| "//sdk/fidl/fuchsia.power:fuchsia.power-rustc", |
| "//sdk/fidl/fuchsia.power:fuchsia.power.test-rustc", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:pin-utils", |
| "//third_party/rust_crates/transitional/rustyline", |
| ] |
| |
| sources = [ |
| "src/commands.rs", |
| "src/main.rs", |
| ] |
| } |
| |
| package("battery-cli") { |
| deps = [ ":battery_cli_bin" ] |
| |
| binaries = [ |
| { |
| name = "battery_cli" |
| shell = true |
| }, |
| ] |
| meta = [ |
| { |
| path = rebase_path("meta/battery_cli.cmx") |
| dest = "battery_cli.cmx" |
| }, |
| ] |
| } |
| |
| test_package("tests") { |
| package_name = "battery-cli-tests" |
| |
| deps = [ ":battery_cli_bin_test" ] |
| |
| tests = [ |
| { |
| name = "battery_cli_bin_test" |
| dest = "battery_cli_tests" |
| environments = basic_envs |
| }, |
| ] |
| } |