| # 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/components.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("update-package") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-url", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//src/sys/pkg/lib/epoch", |
| "//src/sys/pkg/lib/fuchsia-hash", |
| "//src/sys/pkg/lib/fuchsia-pkg", |
| "//src/sys/pkg/lib/version", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:sha2", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:proptest", |
| "//third_party/rust_crates:proptest-derive", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| sources = [ |
| "src/board.rs", |
| "src/epoch.rs", |
| "src/hash.rs", |
| "src/image.rs", |
| "src/images.rs", |
| "src/lib.rs", |
| "src/name.rs", |
| "src/packages.rs", |
| "src/update_mode.rs", |
| "src/version.rs", |
| ] |
| |
| if (!is_host) { |
| deps += [ "//src/lib/zircon/rust:fuchsia-zircon" ] |
| } |
| } |
| |
| fuchsia_component("test-component") { |
| component_name = "update-package-lib-test" |
| visibility = [ ":*" ] |
| testonly = true |
| deps = [ ":update-package_test" ] |
| manifest = "meta/update-package-lib-test.cml" |
| } |
| |
| fuchsia_test_package("update-package-tests") { |
| test_components = [ ":test-component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| # While this crate builds for host, most of its tests cannot run on host |
| # without a library to serve a tempdir over fuchsia.io.Directory. Avoid |
| # adding any tests that would run only on host. |
| # For now, just ensure this crate builds for host in non-test mode. |
| #":update-package_test($host_toolchain)", |
| ":update-package($host_toolchain)", |
| ":update-package-tests", |
| ] |
| } |