| # 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/components.gni") |
| import("//build/dist/renamed_binary.gni") |
| import("//build/rust/rustc_library.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 = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_rust", |
| "//sdk/fidl/fuchsia.paver:fuchsia.paver_rust", |
| "//sdk/fidl/fuchsia.update:fuchsia.update_rust", |
| "//sdk/fidl/fuchsia.update.channelcontrol:fuchsia.update.channelcontrol_rust", |
| "//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_rust", |
| "//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", |
| "//third_party/rust_crates:termion", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia-sync", |
| "//third_party/rust_crates:assert_matches", |
| ] |
| |
| 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/monitor_state.rs", |
| "src/monitor_updates.rs", |
| "src/revert.rs", |
| ] |
| |
| visibility = [ |
| ":*", |
| "//src/sys/pkg/bin/multi-universal-tool:*", |
| ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| renamed_binary("update-binary") { |
| source = "$root_out_dir/multi_universal_tool" |
| source_deps = [ "//src/sys/pkg/bin/multi-universal-tool" ] |
| dest = "bin/update" |
| } |
| |
| fuchsia_package("update") { |
| # We have to rename the package to avoid colliding with the update package. |
| package_name = "update-bin" |
| deps = [ ":update-binary" ] |
| } |
| |
| fuchsia_unittest_package("update-lib-tests") { |
| deps = [ ":lib_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":update-lib-tests" ] |
| } |