| # Copyright 2021 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_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| fxfs_deps = [ |
| "//src/lib/fuchsia-async", |
| "//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:either-v1_5_0", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:num", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| fxfs_test_deps = [ "//third_party/rust_crates:matches" ] |
| |
| fxfs_sources = [ |
| "src/device.rs", |
| "src/device/buffer.rs", |
| "src/device/buffer_allocator.rs", |
| "src/device/file_backed_device.rs", |
| "src/errors.rs", |
| "src/lib.rs", |
| "src/lsm_tree.rs", |
| "src/lsm_tree/merge.rs", |
| "src/lsm_tree/simple_persistent_layer.rs", |
| "src/lsm_tree/skip_list_layer.rs", |
| "src/lsm_tree/types.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/constants.rs", |
| "src/object_store/directory.rs", |
| "src/object_store/filesystem.rs", |
| "src/object_store/fsck.rs", |
| "src/object_store/journal.rs", |
| "src/object_store/journal/reader.rs", |
| "src/object_store/journal/super_block.rs", |
| "src/object_store/journal/writer.rs", |
| "src/object_store/merge.rs", |
| "src/object_store/record.rs", |
| "src/object_store/testing.rs", |
| "src/object_store/testing/fake_allocator.rs", |
| "src/object_store/testing/fake_filesystem.rs", |
| "src/object_store/transaction.rs", |
| "src/testing.rs", |
| "src/testing/fake_device.rs", |
| "src/testing/fake_object.rs", |
| "src/volume.rs", |
| ] |
| |
| if (is_fuchsia) { |
| fxfs_deps += [ |
| "//sdk/fidl/fuchsia.fs:fuchsia.fs-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/storage/block_client/rust:remote-block-device", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| fxfs_test_deps += [ "//garnet/lib/rust/io_util" ] |
| fxfs_sources += [ |
| "src/device/block_device.rs", |
| "src/server.rs", |
| "src/server/directory.rs", |
| "src/server/errors.rs", |
| "src/server/file.rs", |
| "src/server/node.rs", |
| "src/server/testing.rs", |
| "src/server/volume.rs", |
| ] |
| } |
| |
| rustc_library("lib") { |
| edition = "2018" |
| with_unit_tests = true |
| name = "fxfs" |
| |
| deps = fxfs_deps |
| sources = fxfs_sources |
| test_deps = fxfs_test_deps |
| } |
| |
| 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", |
| ":lib_test($host_toolchain)", |
| ] |
| } |
| |
| rustc_binary("fxfs") { |
| edition = "2018" |
| deps = [ |
| ":lib", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/storage/block_client/rust:remote-block-device", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| ] |
| sources = [ "src/main.rs" ] |
| } |