blob: 6d063893e6a99f9fcc7dcdf16fef421b647f7564 [file] [log] [blame]
# Copyright 2018 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("//tools/fidl/measure-tape/measure_tape.gni")
measure_tape("measure_fuchsia_pkg") {
fidls = [ "//sdk/fidl/fuchsia.pkg" ]
target_types = [
"fuchsia.pkg/PackageIndexEntry",
"fuchsia.pkg/BlobId",
"fuchsia.pkg/BlobInfo",
]
target_binding = "rust"
}
rustc_library("fidl-fuchsia-pkg-ext") {
version = "0.1.0"
edition = "2021"
with_unit_tests = true
deps = [
":measure_fuchsia_pkg",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-url",
"//src/lib/http-uri-ext",
"//src/lib/zircon/rust:fuchsia-zircon-types",
"//src/sys/pkg/lib/fuchsia-hash",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:http",
"//third_party/rust_crates:proptest",
"//third_party/rust_crates:proptest-derive",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:typed-builder",
]
if (is_fuchsia) {
deps += [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//src/lib/zircon/rust:fuchsia-zircon-status",
"//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust",
"//src/storage/lib/blob_writer:blob-writer",
"//src/sys/pkg/lib/fuchsia-pkg",
"//third_party/rust_crates:async-trait",
]
}
test_deps = [
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/zircon/rust:fuchsia-zircon-status",
"//src/sys/pkg/lib/fuchsia-pkg",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tracing",
]
if (is_fuchsia) {
test_deps += [
"//src/storage/lib/delivery_blob",
"//src/sys/pkg/lib/fuchsia-merkle",
"//src/sys/pkg/testing/blobfs-ramdisk",
]
}
sources = [
"src/base_package_index.rs",
"src/cache.rs",
"src/cache/storage.rs",
"src/errors.rs",
"src/fidl_iterator_to_stream.rs",
"src/lib.rs",
"src/measure.rs",
"src/repo.rs",
"src/serve_fidl_iterator.rs",
"src/types.rs",
]
}
fuchsia_unittest_package("fidl-fuchsia-pkg-ext-tests") {
deps = [
":fidl-fuchsia-pkg-ext_test",
"//src/storage/fxfs:fxfs_component",
"//src/storage/testing:storage_driver_test_realm",
]
}
group("tests") {
testonly = true
public_deps = [
":fidl-fuchsia-pkg-ext-tests",
":fidl-fuchsia-pkg-ext_test($host_toolchain)",
]
}