| # Copyright 2019 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") |
| |
| rustc_binary("bin") { |
| name = "regulatory_region" |
| edition = "2021" |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.location.namedplace:fuchsia.location.namedplace_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| test_deps = [ |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:pin-utils", |
| "//third_party/rust_crates:tempfile", |
| ] |
| with_unit_tests = true |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| rustc_library("lib") { |
| name = "regulatory_region_lib" |
| edition = "2021" |
| deps = [ |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tracing", |
| ] |
| test_deps = [ |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:futures-test", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| with_unit_tests = true |
| |
| sources = [ |
| "src/lib.rs", |
| "src/pub_sub_hub.rs", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":regulatory-region-tests", |
| "tests", |
| ] |
| } |
| |
| fuchsia_package_with_single_component("regulatory_region") { |
| deps = [ ":bin" ] |
| manifest = "meta/regulatory_region.cml" |
| } |
| |
| fuchsia_unittest_component("regulatory-region-test") { |
| manifest = "meta/regulatory_region_test.cml" |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_unittest_component("regulatory-region-lib-test") { |
| manifest = "meta/regulatory_region_lib_test.cml" |
| deps = [ ":lib_test" ] |
| } |
| |
| fuchsia_test_package("regulatory-region-tests") { |
| test_components = [ |
| ":regulatory-region-test", |
| ":regulatory-region-lib-test", |
| ] |
| } |