| # Copyright 2022 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/rust/rustc_library.gni") |
| |
| relative_root_out_dir = rebase_path(root_out_dir, root_build_dir) |
| rustc_library("fuchsia-repo") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-url", |
| "//src/lib/mundane:mundane", |
| "//src/lib/versioning/version-history/rust:version-history", |
| "//src/storage/lib/delivery_blob", |
| "//src/sys/lib/fidl-fuchsia-pkg-ext", |
| "//src/sys/pkg/lib/far/rust:fuchsia-archive", |
| "//src/sys/pkg/lib/fuchsia-hash", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//src/sys/pkg/lib/fuchsia-pkg", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:bytes", |
| "//third_party/rust_crates:camino", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:data-encoding", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:http", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| "//third_party/rust_crates:tuf", |
| "//third_party/rust_crates:url", |
| "//third_party/rust_crates:walkdir", |
| ] |
| |
| if (is_host) { |
| deps += [ |
| "//src/developer/ffx/lib/rcs:lib", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/gcs", |
| "//src/lib/http-sse:http_sse", |
| "//src/sys/lib/notify-batch-watcher", |
| "//third_party/rust_crates:async-lock", |
| "//third_party/rust_crates:async-net", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:notify", |
| "//third_party/rust_crates:pin-project", |
| "//third_party/rust_crates:tokio", |
| ] |
| } |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//src/sys/pkg/lib/fuchsia-pkg", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:proptest", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| if (is_host) { |
| test_deps += [ |
| "//src/developer/ffx/lib/pkg:empty-repo-keys", |
| "//src/developer/ffx/lib/pkg:empty-repo-metadata", |
| "//src/lib/fuchsia-hyper", |
| "//third_party/rust_crates:pretty_assertions", |
| ] |
| } |
| |
| sources = [ |
| "src/lib.rs", |
| "src/manager.rs", |
| "src/package_manifest_watcher.rs", |
| "src/range.rs", |
| "src/repo_builder.rs", |
| "src/repo_client.rs", |
| "src/repo_keys.rs", |
| "src/repository.rs", |
| "src/repository/file_system.rs", |
| "src/repository/gcs_repository.rs", |
| "src/repository/http_repository.rs", |
| "src/repository/pm.rs", |
| "src/repository/repo_tests.rs", |
| "src/resource.rs", |
| "src/server.rs", |
| "src/test_utils.rs", |
| "src/util.rs", |
| ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| rustenv = [ "ROOT_OUT_DIR=$relative_root_out_dir" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":fuchsia-repo_test", |
| ":fuchsia-repo_test($host_toolchain)", |
| ] |
| } |