| # 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/host.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/zircon/tools.gni") |
| import("//src/developer/ffx/build/ffx_tool.gni") |
| |
| assert(is_host) |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ffx_assembly_args_test", |
| ":ffx_assembly_test", |
| ] |
| } |
| |
| rustc_library("ffx_assembly_args") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| sources = [ "src/args.rs" ] |
| source_root = "src/args.rs" |
| |
| deps = [ |
| "//src/lib/assembly/cli_args", |
| "//src/lib/assembly/images_config", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:camino", |
| ] |
| } |
| |
| rustc_library("ffx_assembly") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| |
| sources = [ |
| "src/lib.rs", |
| "src/operations.rs", |
| "src/operations/create_update.rs", |
| "src/operations/size_check.rs", |
| "src/operations/size_check/breakdown.rs", |
| "src/operations/size_check/common.rs", |
| "src/operations/size_check/diff.rs", |
| "src/operations/size_check/package.rs", |
| "src/operations/size_check/product.rs", |
| "src/operations/size_check/visualization.rs", |
| "src/subpackage_blobs_package.rs", |
| ] |
| inputs = [ |
| "src/operations/size_check/index.html", |
| "src/operations/size_check/D3BlobTreeMap.js", |
| "//scripts/third_party/d3_v3/d3.js", |
| "//scripts/third_party/d3_v3/LICENSE", |
| ] |
| |
| deps = [ |
| ":ffx_assembly_args", |
| "//src/developer/ffx/config:lib", |
| "//src/developer/ffx/lib/errors:lib", |
| "//src/developer/ffx/lib/fho:lib", |
| "//src/developer/ffx/lib/pbms:lib", |
| "//src/developer/ffx/lib/writer:lib", |
| "//src/lib/assembly/api", |
| "//src/lib/assembly/assembled_system", |
| "//src/lib/assembly/blob_size", |
| "//src/lib/assembly/components", |
| "//src/lib/assembly/container", |
| "//src/lib/assembly/partitions_config", |
| "//src/lib/assembly/sdk", |
| "//src/lib/assembly/subpackage_blobs_package", |
| "//src/lib/assembly/tool", |
| "//src/lib/assembly/update_package", |
| "//src/lib/assembly/update_packages_manifest", |
| "//src/lib/assembly/util", |
| "//src/lib/fuchsia-url", |
| "//src/lib/gcs", |
| "//src/lib/structured_ui", |
| "//src/sys/pkg/lib/epoch", |
| "//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:async-trait", |
| "//third_party/rust_crates:camino", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:textwrap", |
| "//third_party/rust_crates:url", |
| ] |
| test_deps = [ |
| "//src/lib/assembly/images_config", |
| "//src/lib/assembly/release_info", |
| "//src/lib/utf8_path", |
| "//src/lib/versioning/version-history/rust", |
| "//src/storage/blobfs/tools:blobfs", |
| "//src/sys/pkg/lib/far/rust:fuchsia-archive", |
| "//third_party/rust_crates:camino", |
| "//third_party/rust_crates:pretty_assertions", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| # TODO(https://fxbug.dev/356474618): re-enable and fix existing lints |
| # configs = [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| ffx_tool("ffx_assembly_tool") { |
| edition = "2021" |
| output_name = "ffx-assembly" |
| deps = [ |
| ":ffx_assembly", |
| "//src/developer/ffx/lib/fho:lib", |
| "//src/lib/fuchsia-async", |
| ] |
| sources = [ "src/main.rs" ] |
| |
| sdk_target_name = "sdk" |
| sdk_category = "partner" |
| |
| # We avoid instrumenting assembly for certain builds as this negatively impacts performance. |
| exclude_toolchain_tags = [ |
| "asan", |
| "coverage", |
| "profile", |
| ] |
| } |
| |
| group("assembly") { |
| public_deps = [ ":ffx_assembly_tool_host_tool" ] |
| } |
| |
| group("bin") { |
| public_deps = [ ":ffx_assembly_tool_versioned" ] |
| } |