| # 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/rust/rustc_binary.gni") |
| import("//src/sys/build/components.gni") |
| import("//src/sys/pkg/bin/system-update-checker/ota_config.gni") |
| |
| rustc_binary("bin") { |
| name = "system_update_checker" |
| with_unit_tests = true |
| edition = "2018" |
| deps = [ |
| "//garnet/lib/rust/io_util", |
| "//garnet/lib/rust/sysconfig-client", |
| "//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt-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.pkg.rewrite:fuchsia.pkg.rewrite-rustc", |
| "//sdk/fidl/fuchsia.update:fuchsia.update-rustc", |
| "//sdk/fidl/fuchsia.update.channel:fuchsia.update.channel-rustc", |
| "//sdk/fidl/fuchsia.update.channelcontrol:fuchsia.update.channelcontrol-rustc", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//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/fuchsia-url", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/fidl-fuchsia-pkg-ext", |
| "//src/sys/pkg/fidl/fuchsia.update.installer:fuchsia.update.installer-rustc", |
| "//src/sys/pkg/lib/async-generator", |
| "//src/sys/pkg/lib/event-queue", |
| "//src/sys/pkg/lib/fidl-fuchsia-update-ext", |
| "//src/sys/pkg/lib/fidl-fuchsia-update-installer-ext", |
| "//src/sys/pkg/lib/fuchsia-hash", |
| "//src/sys/pkg/lib/update-package", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//src/sys/pkg/testing/mock-paver", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:proptest", |
| "//third_party/rust_crates:proptest-derive", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| sources = [ |
| "src/apply.rs", |
| "src/channel.rs", |
| "src/channel_handler.rs", |
| "src/check.rs", |
| "src/config.rs", |
| "src/connect.rs", |
| "src/errors.rs", |
| "src/main.rs", |
| "src/poller.rs", |
| "src/rate_limiter.rs", |
| "src/update_manager.rs", |
| "src/update_monitor.rs", |
| "src/update_service.rs", |
| ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "system-update-checker" |
| manifest = "meta/system-update-checker.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("system-update-checker") { |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_unittest_component("system-update-checker-bin-test") { |
| manifest = "meta/system-update-checker-bin-test.cmx" |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_component("sbase-test") { |
| component_name = "test" |
| deps = [ "//third_party/sbase:test_bin" ] |
| manifest = "meta/test-shell-command.cmx" |
| } |
| |
| fuchsia_test_package("system-update-checker-tests") { |
| test_components = [ ":system-update-checker-bin-test" ] |
| deps = [ ":sbase-test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| fuchsia_component("system-update-checker-for-integration-test") { |
| testonly = true |
| manifest = "meta/system-update-checker-for-integration-test.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| ota_config("auto_update") { |
| # Check for updates every 60 minutes |
| poll_frequency_minutes = 60 |
| } |
| |
| config_data("config") { |
| for_pkg = "sysmgr" |
| outputs = [ "system_update_checker_sysmgr.config" ] |
| sources = [ "sysmgr.config" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ ":system-update-checker-tests" ] |
| } |