| # 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/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//src/sys/build/components.gni") |
| |
| fxfs_deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/storage/block_client/rust:remote-block-device", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:bincode", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:serde", |
| ] |
| |
| fxfs_sources = [ |
| "src/device.rs", |
| "src/directory.rs", |
| "src/lib.rs", |
| "src/lsm_tree.rs", |
| "src/lsm_tree/merge.rs", |
| "src/lsm_tree/simple_persistent_layer.rs", |
| "src/lsm_tree/single_item_layer.rs", |
| "src/lsm_tree/skip_list_layer.rs", |
| "src/lsm_tree/tests.rs", |
| "src/mkfs.rs", |
| "src/mount.rs", |
| "src/object_handle.rs", |
| "src/object_store.rs", |
| "src/object_store/allocator.rs", |
| "src/object_store/allocator/merge.rs", |
| "src/object_store/allocator/tests.rs", |
| "src/object_store/constants.rs", |
| "src/object_store/directory.rs", |
| "src/object_store/filesystem.rs", |
| "src/object_store/log.rs", |
| "src/object_store/merge.rs", |
| "src/object_store/record.rs", |
| "src/object_store/tests.rs", |
| "src/testing/mod.rs", |
| "src/testing/fake_device.rs", |
| ] |
| |
| rustc_library("lib") { |
| edition = "2018" |
| with_unit_tests = true |
| name = "fxfs" |
| |
| deps = fxfs_deps |
| sources = fxfs_sources |
| } |
| |
| fuchsia_component("fxfs-test") { |
| testonly = true |
| deps = [ ":lib_test" ] |
| manifest = "meta/fxfs_lib_test.cml" |
| } |
| |
| fuchsia_test_package("fxfs-tests") { |
| test_components = [ ":fxfs-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fxfs-tests" ] |
| } |
| |
| rustc_binary("fxfs") { |
| edition = "2018" |
| deps = [ |
| ":lib", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/storage/block_client/rust:remote-block-device", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| ] |
| sources = [ "src/main.rs" ] |
| } |