| # 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/host.gni") |
| import("//build/rust/rustc_binary_sdk.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| |
| rustc_library("json5format") { |
| name = "json5format" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:regex", |
| ] |
| |
| test_deps = [ |
| "//src/lib/test_util", |
| "//third_party/rust_crates:proptest", |
| ] |
| } |
| |
| rustc_binary_sdk("formatjson5") { |
| name = "formatjson5" |
| with_unit_tests = true |
| edition = "2018" |
| |
| category = "partner" |
| |
| deps = [ |
| ":json5format", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:structopt", |
| ] |
| } |
| |
| install_host_tools("host") { |
| deps = [ ":formatjson5" ] |
| |
| outputs = [ "formatjson5" ] |
| } |
| |
| unittest_package("json5format-tests") { |
| deps = [ ":json5format_test" ] |
| |
| tests = [ |
| { |
| name = "json5format_lib_test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":formatjson5_test($host_toolchain)", |
| ":json5format-tests", |
| ] |
| } |