| # 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/testing/host_test_data.gni") |
| import("//build/zircon/tools.gni") |
| import("//src/developer/ffx/build/ffx_plugin.gni") |
| |
| ffx_plugin("ffx_assembly") { |
| version = "0.1.0" |
| edition = "2018" |
| with_unit_tests = true |
| sources = [ |
| "src/args.rs", |
| "src/base_package.rs", |
| "src/blobfs.rs", |
| "src/config.rs", |
| "src/extra_hash_descriptor.rs", |
| "src/fvm.rs", |
| "src/lib.rs", |
| "src/operations.rs", |
| "src/operations/extract.rs", |
| "src/operations/image.rs", |
| "src/operations/vbmeta.rs", |
| "src/update_package.rs", |
| "src/util.rs", |
| "src/vbmeta.rs", |
| "src/vfs.rs", |
| "src/zbi.rs", |
| ] |
| args_deps = [] |
| deps = [ |
| "//src/lib/assembly/base_package", |
| "//src/lib/assembly/blobfs", |
| "//src/lib/assembly/fvm", |
| "//src/lib/assembly/test_keys", |
| "//src/lib/assembly/update_package", |
| "//src/lib/assembly/util", |
| "//src/lib/assembly/vbmeta", |
| "//src/lib/assembly/zbi", |
| "//src/lib/zerocopy", |
| "//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:hex", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:serde_json5", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| test_deps = [ |
| ":tools_for_testing", |
| "//src/lib/assembly/test_keys", |
| "//third_party/rust_crates:matches", |
| ] |
| } |
| |
| # The blobfs tool is currently only available on the base host toolchain. |
| # The assembly tool currently assumes host_x64/<tool> locations. |
| _blobfs_target = "//zircon/tools/blobfs(${toolchain_variant.base})" |
| _blobfs_path = get_label_info(_blobfs_target, "root_out_dir") + "/blobfs" |
| _fvm_target = "//src/storage/bin/fvm(${toolchain_variant.base})" |
| _fvm_path = get_label_info(_fvm_target, "root_out_dir") + "/fvm" |
| _zbi_target = "//zircon/tools/zbi(${toolchain_variant.base})" |
| _zbi_path = get_label_info(_zbi_target, "root_out_dir") + "/zbi" |
| host_test_data("tools_for_testing") { |
| sources = [ |
| _blobfs_path, |
| _fvm_path, |
| _zbi_path, |
| ] |
| deps = [ |
| _blobfs_target, |
| _fvm_target, |
| _zbi_target, |
| ] |
| } |