| # Copyright 2019 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/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_library("lib") { |
| name = "archivist_lib" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//garnet/public/lib/fidl/rust/fidl", |
| "//garnet/public/rust/fdio", |
| "//garnet/public/rust/fuchsia-async", |
| "//garnet/public/rust/fuchsia-component", |
| "//garnet/public/rust/fuchsia-vfs/fuchsia-watch", |
| "//garnet/public/rust/fuchsia-vfs/pseudo-fs", |
| "//garnet/public/rust/fuchsia-zircon", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc", |
| "//sdk/fidl/fuchsia.diagnostics.inspect:fuchsia.diagnostics.inspect-rustc", |
| "//sdk/fidl/fuchsia.diagnostics.stream:fuchsia.diagnostics.stream-rustc", |
| "//src/diagnostics/lib/inspect-fidl-load", |
| "//src/diagnostics/lib/inspect-formatter", |
| "//src/diagnostics/lib/selectors", |
| "//src/diagnostics/lib/validating-log-listener", |
| "//src/diagnostics/streams:lib", |
| "//src/lib/inspect/rust/fuchsia-inspect", |
| "//src/lib/inspect/rust/fuchsia-inspect-contrib", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:failure", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:json5", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:paste", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_derive", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//zircon/system/fidl/fuchsia-inspect:fuchsia-inspect-rustc", |
| "//zircon/system/fidl/fuchsia-inspect-deprecated:fuchsia-inspect-deprecated-rustc", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| "//zircon/system/fidl/fuchsia-logger:fuchsia-logger-rustc", |
| "//zircon/system/fidl/fuchsia-mem:fuchsia-mem-rustc", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| name = "archivist" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| ":lib", |
| "//garnet/lib/rust/io_util", |
| "//garnet/public/lib/fidl/rust/fidl", |
| "//garnet/public/rust/fuchsia-async", |
| "//garnet/public/rust/fuchsia-component", |
| "//garnet/public/rust/fuchsia-zircon", |
| "//sdk/fidl/fuchsia.diagnostics.inspect:fuchsia.diagnostics.inspect-rustc", |
| "//src/diagnostics/lib/selectors", |
| "//src/lib/argh", |
| "//third_party/rust_crates:failure", |
| "//third_party/rust_crates:futures", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| ] |
| } |
| |
| package("archivist") { |
| global_data = "//build" |
| |
| deps = [ |
| ":bin", |
| ] |
| |
| binaries = [ |
| { |
| name = "archivist" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/archivist.cmx") |
| dest = "archivist.cmx" |
| }, |
| { |
| path = rebase_path("meta/observer.cmx") |
| dest = "observer.cmx" |
| }, |
| ] |
| } |
| |
| config_data("archivist_config") { |
| for_pkg = "archivist" |
| outputs = [ |
| "archivist_config.json", |
| ] |
| |
| sources = [ |
| "configs/archivist_config.json", |
| ] |
| } |
| |
| config_data("observer_config") { |
| for_pkg = "archivist" |
| outputs = [ |
| "observer_config.json", |
| ] |
| |
| sources = [ |
| "configs/observer_config.json", |
| ] |
| } |
| |
| config_data("archivist_startup") { |
| for_pkg = "sysmgr" |
| outputs = [ |
| "archivist.config", |
| ] |
| |
| sources = [ |
| "configs/sysmgr_config.json", |
| ] |
| } |
| |
| group("with_default_config") { |
| deps = [ |
| ":archivist", |
| ":archivist_config", |
| ":archivist_startup", |
| ":observer_config", |
| ] |
| } |
| |
| test_package("archivist_tests") { |
| deps = [ |
| ":lib_test", |
| ] |
| |
| tests = [ |
| { |
| name = "archivist_lib_lib_test" |
| dest = "archivist_tests" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":archivist_tests", |
| "//src/diagnostics/archivist/tests:logger_integration_tests", |
| "//src/diagnostics/archivist/tests/data_stats", |
| "//src/diagnostics/archivist/tests/inspect_reader_integration:inspect_reader_integration_tests", |
| ] |
| } |