| # Copyright 2018 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/package.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| |
| # `pkgctl` is conceptually a binary, but it built as a lib here so it can be |
| # aggregated into //src/sys/pkg/bin/multi-universal-tool to save disk space. |
| rustc_library("lib") { |
| name = "pkgctl" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "//garnet/lib/rust/files_async", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc", |
| "//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite-rustc", |
| "//sdk/fidl/fuchsia.space:fuchsia.space-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/fidl-fuchsia-pkg-ext", |
| "//src/sys/lib/fidl-fuchsia-pkg-rewrite-ext", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| source_root = "src/main.rs" |
| sources = [ |
| "src/args.rs", |
| "src/error.rs", |
| "src/main.rs", |
| ] |
| |
| visibility = [ |
| ":*", |
| "//src/sys/pkg/bin/multi-universal-tool:*", |
| ] |
| } |
| |
| package("pkgctl-bin") { |
| package_name = "pkgctl" |
| deps = [ "//src/sys/pkg/bin/multi-universal-tool" ] |
| |
| binaries = [ |
| { |
| name = "pkgctl" |
| source = "multi_universal_tool" |
| shell = true |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/pkgctl.cmx") |
| dest = "pkgctl.cmx" |
| }, |
| ] |
| } |
| |
| unittest_package("pkgctl-tests") { |
| deps = [ ":lib_test" ] |
| |
| tests = [ |
| { |
| name = "pkgctl_lib_test" |
| dest = "pkgctl-test" |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":pkgctl-tests" ] |
| } |