| # 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/config.gni") |
| import("//build/json/validate_json.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//src/sys/build/components.gni") |
| |
| template("temperature_logger_config") { |
| config_data("${target_name}_config_data") { |
| for_pkg = "temperature-logger" |
| sources = [ "${invoker.source}" ] |
| outputs = [ "config.json" ] |
| } |
| |
| validate_json("${target_name}_validate_json") { |
| data = "${invoker.source}" |
| schema = "config/config.schema.json" |
| } |
| |
| group(target_name) { |
| deps = [ |
| ":${target_name}_config_data", |
| ":${target_name}_validate_json", |
| ] |
| } |
| } |
| |
| temperature_logger_config("astro_config") { |
| source = "config/astro_config.json" |
| } |
| |
| rustc_binary("bin") { |
| name = "temperature_logger" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.device:fuchsia.device-rustc", |
| "//sdk/fidl/fuchsia.hardware.temperature:fuchsia.hardware.temperature-rustc", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/trace/rust:trace", |
| "//src/lib/trace/rust:trace-provider", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/power/temperature-logger/fuchsia.thermal.test:fuchsia.thermal.test-rustc", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_derive", |
| "//third_party/rust_crates:serde_json", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_package_with_single_component("temperature-logger") { |
| manifest = "meta/temperature-logger.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_unittest_package("temperature-logger-tests") { |
| manifest = "meta/temperature_logger_bin_test.cml" |
| deps = [ ":bin_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":temperature-logger-tests" ] |
| } |