blob: a66a639c7fce44a08430e711262c28946c8dc15a [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/components.gni")
import("//build/images/args.gni")
import("//build/rust/rustc_binary.gni")
import("//tools/fidl/measure-tape/measure_tape.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 = "2021"
deps = [
":measure_tape_for_stash",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/zircon/rust:fuchsia-zircon",
"//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",
"//third_party/rust_crates:tracing",
]
sources = [
"src/accessor.rs",
"src/instance.rs",
"src/main.rs",
"src/store.rs",
]
}
measure_tape("measure_tape_for_stash") {
target_binding = "rust"
target_types = [
"fuchsia.stash/ListItem",
"fuchsia.stash/KeyValue",
]
fidls = [
"//sdk/fidl/fuchsia.stash",
"//sdk/fidl/fuchsia.mem",
]
}
# TODO(fxbug.dev/83213) Retain v1 component while out of tree tests need it.
fuchsia_component("stash_secure") {
deps = [ ":bin" ]
manifest = "meta/stash_secure.cmx"
}
fuchsia_component("stash_secure_v2") {
component_name = "stash_secure"
deps = [ ":bin" ]
manifest = "meta/stash_secure.cml"
}
# TODO(fxbug.dev/83213) Retain v1 component while out of tree tests need it.
fuchsia_component("stash_cmp") {
component_name = "stash"
deps = [ ":bin" ]
manifest = "meta/stash.cmx"
}
fuchsia_component("stash_v2") {
component_name = "stash"
deps = [ ":bin" ]
manifest = "meta/stash.cml"
}
fuchsia_component("stash2_v2") {
component_name = "stash2"
deps = [ ":bin" ]
manifest = "meta/stash2.cml"
}
fuchsia_package("pkg") {
package_name = "stash"
deps = [
":stash2_v2",
":stash_cmp",
":stash_secure",
":stash_secure_v2",
":stash_v2",
]
}
# TODO(fxbug.dev/100447): Change the contents of the stash package
# based on build type (user, eng, userdebug) rather than using
# a different package altogether.
fuchsia_package("pkg_eng") {
package_name = "stash"
deps = [
":stash2_v2",
":stash_cmp",
":stash_secure",
":stash_secure_v2",
":stash_v2",
"//src/sys/tools/stash_ctl:bin",
]
}
fuchsia_unittest_package("stash-tests") {
manifest = "meta/stash_bin_test.cml"
deps = [ ":bin_test" ]
}