| # Copyright 2020 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/rust/rustc_binary.gni") |
| import("//build/security.gni") |
| import("//src/sys/build/components.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":example", |
| ":universe-resolver-unittests", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| output_name = "universe_resolver" |
| |
| # Generates a GN target for unit-tests with the label `bin_test`, and |
| # a binary named `universe_resolver_bin_test`. |
| with_unit_tests = true |
| |
| deps = [ |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.data:fuchsia.data-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-url", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/sys/lib/fuchsia-component-test", |
| "//third_party/rust_crates:matches", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "universe-resolver" |
| manifest = "meta/universe-resolver.cml" |
| deps = [ ":bin" ] |
| |
| deps += [ "//build/validate:non_production_tag" ] |
| } |
| |
| fuchsia_component("component-for-test") { |
| testonly = true |
| component_name = "universe-resolver-for-test" |
| manifest = "meta/universe-resolver-for-test.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_component("component-base-only") { |
| manifest = "meta/universe-resolver-base-only.cml" |
| component_name = "universe-resolver" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_component("component-base-only-for-test") { |
| testonly = true |
| manifest = "meta/universe-resolver-base-only-for-test.cml" |
| component_name = "universe-resolver-base-only-for-test" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("universe-resolver") { |
| if (auto_update_packages) { |
| deps = [ ":component" ] |
| } else { |
| deps = [ ":component-base-only" ] |
| } |
| } |
| |
| fuchsia_component("example") { |
| manifest = "meta/example.cml" |
| } |
| |
| fuchsia_component("unittests") { |
| manifest = "meta/universe-resolver-unittests.cml" |
| component_name = "universe-resolver-unittests" |
| deps = [ ":bin_test" ] |
| testonly = true |
| } |
| |
| # Run with `fx test universe-resolver-unittests`. |
| fuchsia_unittest_package("universe-resolver-unittests") { |
| manifest = "meta/universe-resolver-unittests.cml" |
| deps = [ |
| ":bin_test", |
| ":component-base-only-for-test", |
| ":component-for-test", |
| ] |
| } |