| # 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_library.gni") |
| import("//build/test/test_package.gni") |
| |
| # `update` is conceptually a binary, but it built as a lib here so it can be |
| # aggregated into //src/sys/pkg/bin/multi-universal-tool to save disk space. |
| rustc_library("lib") { |
| name = "update" |
| with_unit_tests = true |
| edition = "2018" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol-rustc", |
| "//sdk/fidl/fuchsia.paver:fuchsia.paver-rustc", |
| "//sdk/fidl/fuchsia.update:fuchsia.update-rustc", |
| "//sdk/fidl/fuchsia.update.channelcontrol:fuchsia.update.channelcontrol-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-url", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/pkg/fidl/fuchsia.update.installer:fuchsia.update.installer-rustc", |
| "//src/sys/pkg/lib/fidl-fuchsia-update-ext", |
| "//src/sys/pkg/lib/fidl-fuchsia-update-installer-ext", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| test_deps = [ |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:parking_lot", |
| ] |
| |
| source_root = "src/main.rs" |
| sources = [ |
| "src/args.rs", |
| "src/channel.rs", |
| "src/check.rs", |
| "src/commit.rs", |
| "src/install.rs", |
| "src/main.rs", |
| "src/revert.rs", |
| ] |
| |
| visibility = [ |
| ":*", |
| "//src/sys/pkg/bin/multi-universal-tool:*", |
| ] |
| } |
| |
| package("update-bin") { |
| deps = [ "//src/sys/pkg/bin/multi-universal-tool" ] |
| binaries = [ |
| { |
| name = "update" |
| source = "multi_universal_tool" |
| shell = true |
| }, |
| ] |
| meta = [ |
| { |
| path = rebase_path("meta/update.cmx") |
| dest = "update.cmx" |
| }, |
| ] |
| } |
| |
| unittest_package("update-lib-tests") { |
| deps = [ ":lib_test" ] |
| |
| tests = [ |
| { |
| name = "update_lib_test" |
| dest = "update-test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":update-lib-tests" ] |
| } |