blob: bd6488ea292acd400dad12cf0b5613b152e9448e [file] [log] [blame]
# 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/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_library.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_binary("bin") {
name = "rolldice"
edition = "2018"
deps = [
":lib",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:structopt",
]
sources = [ "src/main.rs" ]
}
rustc_library("lib") {
name = "rolldice_lib"
edition = "2018"
with_unit_tests = true
deps = [ "//third_party/rust_crates:rand" ]
sources = [ "src/lib.rs" ]
}
package("rolldice") {
deps = [ ":bin" ]
binaries = [
{
name = "rolldice"
shell = true
},
]
meta = [
{
path = rebase_path("meta/rolldice.cmx")
dest = "rolldice.cmx"
},
]
}
unittest_package("rolldice-tests") {
deps = [ ":lib_test" ]
tests = [
{
name = "rolldice_lib_lib_test"
environments = basic_envs
},
]
}