blob: 5b1f1d3e90ec5b7007809cc31bb20512142236d4 [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/test/test_package.gni")
import("//build/testing/environments.gni")
import("//src/sys/build/components.gni")
group("stash") {
testonly = true
deps = [
":pkg",
":tests",
]
}
group("tests") {
testonly = true
deps = [
":stash-tests",
"tests",
]
}
rustc_binary("bin") {
name = "stash"
with_unit_tests = true
edition = "2018"
deps = [
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc",
"//sdk/fidl/fuchsia.stash:rust_measure_tape_for_key_value",
"//sdk/fidl/fuchsia.stash:rust_measure_tape_for_list_item",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/lib/zircon/rust:fuchsia-zircon-sys",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:byteorder",
"//third_party/rust_crates:bytes",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/accessor.rs",
"src/instance.rs",
"src/main.rs",
"src/store.rs",
]
}
fuchsia_component("stash_secure") {
manifest = "meta/stash_secure.cmx"
deps = [ ":bin" ]
}
# TODO: migrate to `fuchsia_package`.
package("pkg") {
package_name = "stash"
deps = [ ":bin" ]
binaries = [
{
name = "stash"
},
]
meta = [
{
path = rebase_path("meta/stash.cmx")
dest = "stash.cmx"
},
{
path = rebase_path("meta/stash2.cmx")
dest = "stash2.cmx"
},
{
path = rebase_path("meta/stash_secure.cmx")
dest = "stash_secure.cmx"
},
]
}
test_package("stash-tests") {
deps = [ ":bin_test" ]
tests = [
{
name = "stash_bin_test"
environments = basic_envs
},
]
}