| # 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("//src/sys/pkg/sysmgr_config.gni") |
| |
| rustc_binary("bin") { |
| name = "system_updater" |
| with_unit_tests = true |
| edition = "2018" |
| deps = [ |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc", |
| "//sdk/fidl/fuchsia.paver:fuchsia.paver-rustc", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc", |
| "//sdk/fidl/fuchsia.space:fuchsia.space-rustc", |
| "//src/lib/cobalt/rust:fuchsia-cobalt", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-url", |
| "//src/lib/mundane", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/pkg/fidl/fuchsia.update.installer:fuchsia.update.installer-rustc", |
| "//src/sys/pkg/lib/async-generator", |
| "//src/sys/pkg/lib/bounded-node", |
| "//src/sys/pkg/lib/event-queue", |
| "//src/sys/pkg/lib/fidl-fuchsia-update-installer-ext", |
| "//src/sys/pkg/lib/metrics:cobalt_sw_delivery_registry_rustlib", |
| "//src/sys/pkg/lib/pkgfs", |
| "//src/sys/pkg/lib/update-package", |
| "//third_party/cobalt/src/lib/client/rust:cobalt-client", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:pin-project", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:uuid", |
| ] |
| test_deps = [ |
| "//src/sys/pkg/lib/fuchsia-pkg-testing", |
| "//src/sys/pkg/lib/version", |
| "//src/sys/pkg/testing/mock-paver", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:pretty_assertions", |
| "//third_party/rust_crates:proptest", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| sources = [ |
| "src/fidl.rs", |
| "src/install_manager.rs", |
| "src/main.rs", |
| "src/update.rs", |
| "src/update/channel.rs", |
| "src/update/config.rs", |
| "src/update/environment.rs", |
| "src/update/genutil.rs", |
| "src/update/history.rs", |
| "src/update/history/version.rs", |
| "src/update/images.rs", |
| "src/update/metrics.rs", |
| "src/update/paver.rs", |
| "src/update/paver/configuration.rs", |
| "src/update/reboot.rs", |
| "src/update/resolver.rs", |
| "src/update/state.rs", |
| ] |
| } |
| |
| package("system-updater") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "system_updater" |
| dest = "system-updater" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/system-updater.cmx") |
| dest = "system-updater.cmx" |
| }, |
| ] |
| |
| resources = [ |
| { |
| path = rebase_path("images") |
| dest = "images" |
| }, |
| ] |
| } |
| |
| test_package("system-updater-tests") { |
| deps = [ ":bin_test" ] |
| |
| tests = [ |
| { |
| name = "system_updater_bin_test" |
| dest = "system-updater-bin-test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| sysmgr_config("config") { |
| source = "sysmgr.config" |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":system-updater-tests" ] |
| } |