| # 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/components.gni") |
| import("//build/dist/renamed_binary.gni") |
| import("//build/rust/rustc_library.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 = "2021" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.net.http:fuchsia.net.http_rust", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust", |
| "//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite_rust", |
| "//sdk/fidl/fuchsia.space:fuchsia.space_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-url", |
| "//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:hex", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| ] |
| test_deps = [ "//third_party/rust_crates:assert_matches" ] |
| |
| source_root = "src/main.rs" |
| sources = [ |
| "src/args.rs", |
| "src/error.rs", |
| "src/main.rs", |
| "src/v1repoconf.rs", |
| ] |
| |
| visibility = [ |
| ":*", |
| "//src/sys/pkg/bin/multi-universal-tool:*", |
| ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| # Copy the multi_universal_tool as 'bin/pkgctl' as required |
| # by the pkgctl package below. Note that the package must |
| # still depend on //src/sys/pkg/bin/multi-universal-tool to |
| # ensure its runtime dependencies are properly installed. |
| renamed_binary("pkgctl-binary") { |
| source = "$root_out_dir/multi_universal_tool" |
| source_deps = [ "//src/sys/pkg/bin/multi-universal-tool" ] |
| dest = "bin/pkgctl" |
| } |
| |
| fuchsia_package("pkgctl") { |
| deps = [ ":pkgctl-binary" ] |
| } |
| |
| fuchsia_unittest_package("pkgctl-tests") { |
| deps = [ ":lib_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":pkgctl-tests" ] |
| } |