| # 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_library.gni") |
| |
| rustc_library("selectors") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect_rust", |
| "//src/sys/lib/moniker", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:bitflags", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:nom", |
| "//third_party/rust_crates:nom-language", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| if (current_build_target_api_level_as_integer > 26) { |
| deps += [ |
| "//sdk/fidl/fuchsia.diagnostics.types:fuchsia.diagnostics.types_rust", |
| ] |
| } |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:test-case", |
| ] |
| |
| sources = [ |
| "src/error.rs", |
| "src/ir.rs", |
| "src/lib.rs", |
| "src/parser.rs", |
| "src/selectors.rs", |
| "src/validate.rs", |
| ] |
| |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| fuchsia_unittest_package("selectors-test") { |
| manifest = "meta/selectors-lib-test.cml" |
| deps = [ ":selectors_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":selectors-test" ] |
| } |
| |
| group("benchmarks") { |
| testonly = true |
| deps = [ "bench" ] |
| } |