| # Copyright 2017 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.gni") |
| |
| # Group added to enable easy building. |
| group("doc_checker") { |
| testonly = true |
| deps = [ ":doc_checker_host_tool($host_toolchain)" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":doc_checker_bin_test($host_toolchain)" ] |
| } |
| |
| # Builds doc_checker, a Rust based binary. |
| if (is_host) { |
| rustc_binary("doc_checker_bin") { |
| edition = "2021" |
| output_name = "doc-checker" |
| with_unit_tests = true |
| testonly = true |
| sources = [ |
| "src/checker.rs", |
| "src/include_checker.rs", |
| "src/link_checker.rs", |
| "src/main.rs", |
| "src/md_element.rs", |
| "src/parser.rs", |
| "src/yaml.rs", |
| "src/yaml/toc_checker.rs", |
| ] |
| deps = [ |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-hyper:fuchsia-hyper", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:cfg-if", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:http", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:pulldown-cmark", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:serde_yaml", |
| "//third_party/rust_crates:url", |
| ] |
| test_deps = [ "//src/lib/fuchsia-async" ] |
| |
| data_deps = [ ":doc_checker_test_data($host_toolchain)" ] |
| } |
| |
| install_host_tools("doc_checker_host_tool") { |
| testonly = true |
| deps = [ ":doc_checker_bin($host_toolchain)" ] |
| |
| outputs = [ "doc-checker" ] |
| } |
| |
| # Test data for doc_checker. |
| host_test_data("doc_checker_test_data") { |
| sources = [ |
| "doc_checker_test_data/docs/README.md", |
| "doc_checker_test_data/docs/_common/_included.md", |
| "doc_checker_test_data/docs/_toc.yaml", |
| "doc_checker_test_data/docs/cycle/_toc.yaml", |
| "doc_checker_test_data/docs/cycle/nested/_toc.yaml", |
| "doc_checker_test_data/docs/gen/build_arguments.md", |
| "doc_checker_test_data/docs/images/fuchsia_icon_256x256.png", |
| "doc_checker_test_data/docs/include_here.md", |
| "doc_checker_test_data/docs/no_readme/_toc.yaml", |
| "doc_checker_test_data/docs/no_readme/details.md", |
| "doc_checker_test_data/docs/path.md", |
| "doc_checker_test_data/docs/second.md", |
| "doc_checker_test_data/docs/unreachable.md", |
| "doc_checker_test_data/docs/unused/_toc.yaml", |
| ] |
| outputs = [ "${root_out_dir}/{{source_target_relative}}" ] |
| } |
| } |