| # 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/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| import("//garnet/bin/system-update-checker/ota_config.gni") |
| |
| rustc_binary("bin") { |
| name = "system_update_checker" |
| with_unit_tests = true |
| edition = "2018" |
| deps = [ |
| "//garnet/public/lib/fidl/rust/fidl", |
| "//garnet/public/rust/fdio", |
| "//garnet/public/rust/fuchsia-async", |
| "//garnet/public/rust/fuchsia-component", |
| "//garnet/public/rust/fuchsia-merkle", |
| "//garnet/public/rust/fuchsia-syslog", |
| "//garnet/public/rust/fuchsia-zircon", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//third_party/rust_crates:failure", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:proptest", |
| "//third_party/rust_crates:tempfile", |
| "//zircon/public/fidl/fuchsia-io:fuchsia-io-rustc", |
| ] |
| } |
| |
| package("system-update-checker") { |
| deprecated_shell = "//build" |
| deps = [ |
| ":bin", |
| ] |
| binaries = [ |
| { |
| name = "system_update_checker" |
| dest = "system-update-checker" |
| shell = true |
| }, |
| ] |
| meta = [ |
| { |
| path = rebase_path("meta/system-update-checker.cmx") |
| dest = "system-update-checker.cmx" |
| }, |
| ] |
| } |
| |
| test_package("system-update-checker-tests") { |
| deps = [ |
| ":bin_test", |
| ] |
| tests = [ |
| { |
| name = "system_update_checker_bin_test" |
| dest = "system-update-checker-bin-test" |
| environments = basic_envs |
| }, |
| ] |
| binaries = [ |
| { |
| name = "exit-with-code" |
| source = rebase_path( |
| "//garnet/bin/system-update-checker/test/exit-with-code.sh") |
| }, |
| ] |
| meta = [ |
| { |
| path = rebase_path( |
| "//garnet/bin/system-update-checker/meta/exit-with-code.cmx") |
| dest = "exit-with-code.cmx" |
| }, |
| ] |
| } |
| |
| ota_config("auto_update") { |
| # Check for updates every 60 minutes |
| poll_frequency_minutes = 60 |
| } |