| # 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") |
| import("//build/testing/environments.gni") |
| |
| rustc_library("isolated-swd") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.paver:fuchsia.paver_rust", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//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-installer-ext", |
| "//src/sys/pkg/lib/omaha-client-fuchsia", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:omaha_client", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component-test", |
| "//src/sys/lib/fidl-fuchsia-pkg-ext", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//src/sys/pkg/lib/fuchsia-pkg-testing", |
| "//src/sys/pkg/testing/blobfs-ramdisk", |
| "//src/sys/pkg/testing/mock-metrics", |
| "//src/sys/pkg/testing/mock-paver", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:serde_json", |
| ] |
| |
| sources = [ |
| "src/cache.rs", |
| "src/lib.rs", |
| "src/omaha.rs", |
| "src/omaha/installer.rs", |
| "src/omaha/policy.rs", |
| "src/resolver.rs", |
| "src/updater.rs", |
| ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| fuchsia_test_component("isolated-swd-tests-component") { |
| component_name = "isolated-swd-tests" |
| manifest = "meta/isolated-swd-tests.cml" |
| deps = [ ":isolated-swd_test" ] |
| } |
| |
| isolated_swd_components = [ |
| "//src/sys/pkg/bin/pkg-cache:ignore-system-image-component-and-config", |
| "//src/sys/pkg/bin/pkg-resolver:production-component-and-config", |
| "//src/sys/pkg/bin/system-updater:production-component-and-config", |
| "//src/sys/pkg/bin/fake-system-update-committer", |
| ] |
| |
| fuchsia_component("pkg-component") { |
| component_name = "pkg" |
| manifest = "//src/sys/pkg/meta/pkg-recovery.cml" |
| deps = isolated_swd_components |
| } |
| |
| fuchsia_test_package("isolated-swd-tests") { |
| test_components = [ ":isolated-swd-tests-component" ] |
| |
| deps = [ |
| "//src/connectivity/network:netstack-for-tests", |
| "//src/connectivity/network/dns:component", |
| "//src/storage/testing:storage_driver_test_realm", |
| "//src/storage/tools/blobfs-compression", |
| "//src/sys/pkg/bin/fake-system-update-committer", |
| "//src/sys/pkg/lib/fuchsia-pkg-testing/certs", |
| "//src/sys/pkg/tests/pkg-resolver:empty-repo", |
| ] |
| deps += isolated_swd_components |
| deps += [ ":pkg-component" ] |
| |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| fuchsia_package("isolated-swd-components") { |
| deps = isolated_swd_components |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ ":isolated-swd-tests" ] |
| } |