| # Copyright 2024 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") |
| import("//build/test.gni") |
| import("//build/testing/environments.gni") |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":bootpkg-lib-tests", |
| ":bootpkg-test", |
| ] |
| } |
| |
| test("bootpkg-test-bin") { |
| testonly = true |
| output_name = "bootpkg-test" |
| visibility = [ ":*" ] |
| |
| sources = [ "test.cc" ] |
| |
| deps = [ |
| "//sdk/lib/fdio", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| rustc_library("lib") { |
| edition = "2024" |
| name = "bootpkg" |
| with_unit_tests = true |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/sys/pkg/lib/far/rust:fuchsia-archive", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//src/sys/pkg/lib/fuchsia-pkg", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| ] |
| test_deps = [ |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/storage/lib/vfs/rust:vfs", |
| "//third_party/rust_crates:maplit", |
| ] |
| sources = [ |
| "src/args.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| rustc_binary("bootpkg") { |
| visibility = [ ":*" ] |
| edition = "2024" |
| configs += [ "//build/config/rust:bootfs" ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fdio/rust:fdio", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_package("package") { |
| package_name = "bootpkg" |
| deps = [ ":bootpkg" ] |
| } |
| |
| fuchsia_unittest_package("bootpkg-lib-tests") { |
| deps = [ ":lib_test" ] |
| } |
| |
| fuchsia_unittest_package("bootpkg-test") { |
| manifest = "meta/bootpkg-test.cml" |
| deps = [ |
| ":bootpkg", |
| ":bootpkg-test-bin", |
| ] |
| test_type = "system" |
| } |