| # 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/host.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| if (host_toolchain == current_toolchain) { |
| rustc_binary("create_bin") { |
| name = "create" |
| deps = [ |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:handlebars", |
| "//third_party/rust_crates:heck", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_derive", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:structopt", |
| "//third_party/rust_crates:termion", |
| ] |
| |
| test_deps = [ |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| with_unit_tests = true |
| |
| sources = [ |
| "src/main.rs", |
| "src/template_helpers.rs", |
| "src/test_util.rs", |
| "src/util.rs", |
| ] |
| } |
| } |
| |
| install_host_tools("install") { |
| deps = [ |
| ":create_bin($host_toolchain)", |
| "templates($host_toolchain)", |
| ] |
| |
| outputs = [ "create" ] |
| } |
| |
| group("create") { |
| testonly = true |
| deps = [ |
| ":install", |
| ":tests", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":create_bin_test($host_toolchain)", |
| "goldens:tests", |
| ] |
| } |