blob: 00f80623b4725803185f6ca7fbb976a3acb8309b [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/config.gni")
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_library("lib") {
name = "sl4f_lib"
with_unit_tests = true
edition = "2018"
# Only for internal use.
visibility = [
":*",
"tests/*",
]
deps = [
"//garnet/lib/rust/connectivity-testing",
"//garnet/lib/rust/fidl_fuchsia_hardware_ethernet_ext",
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//garnet/lib/wlan/fidl:fidl-rustc",
"//garnet/lib/wlan/fidl:service-rustc",
"//garnet/lib/wlan/fidl:sme-rustc",
"//garnet/public/lib/fidl/rust/fidl",
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-component",
"//garnet/public/rust/fuchsia-scenic",
"//garnet/public/rust/fuchsia-syslog",
"//garnet/public/rust/fuchsia-vfs/fuchsia-vfs-watcher",
"//garnet/public/rust/fuchsia-zircon",
"//sdk/fidl/fuchsia.auth:fuchsia.auth-rustc",
"//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth-rustc",
"//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr-rustc",
"//sdk/fidl/fuchsia.bluetooth.control:fuchsia.bluetooth.control-rustc",
"//sdk/fidl/fuchsia.bluetooth.gatt:fuchsia.bluetooth.gatt-rustc",
"//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le-rustc",
"//sdk/fidl/fuchsia.factory:fuchsia.factory-rustc",
"//sdk/fidl/fuchsia.images:fuchsia.images-rustc",
"//sdk/fidl/fuchsia.intl:fuchsia.intl-rustc",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.modular.internal:fuchsia.modular.internal-rustc",
"//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc",
"//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc",
"//sdk/fidl/fuchsia.setui:fuchsia.setui-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app-rustc",
"//sdk/fidl/fuchsia.ui.policy:fuchsia.ui.policy-rustc",
"//sdk/fidl/fuchsia.ui.scenic:fuchsia.ui.scenic-rustc",
"//sdk/fidl/fuchsia.virtualaudio:fuchsia.virtualaudio-rustc",
"//sdk/fidl/fuchsia.web:fuchsia.web-rustc",
"//sdk/fidl/fuchsia.wlan.policy:fuchsia.wlan.policy-rustc",
"//src/connectivity/bluetooth/lib/fuchsia-bluetooth",
"//src/lib/mapped-vmo",
"//src/lib/test_executor/rust:test_executor",
"//third_party/rust_crates:base64",
"//third_party/rust_crates:byteorder",
"//third_party/rust_crates:failure",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:glob",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:rouille",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_derive",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:slab",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:uuid",
"//third_party/rust_crates:void",
"//zircon/system/fidl/fuchsia-hardware-ethernet:fuchsia-hardware-ethernet-rustc",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
"//zircon/system/fidl/fuchsia-mem:fuchsia-mem-rustc",
"//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc",
"//zircon/system/fidl/fuchsia-paver:fuchsia-paver-rustc",
]
test_deps = [
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-vfs/pseudo-fs",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:maplit",
]
}
rustc_binary("bin") {
name = "sl4f"
with_unit_tests = true
edition = "2018"
deps = [
":lib",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-syslog",
"//third_party/rust_crates:failure",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:rouille",
]
}
package("sl4f") {
deprecated_shell = "//build"
meta = [
{
path = "meta/sl4f.cmx"
dest = "sl4f.cmx"
},
]
deps = [
":bin",
]
binary = "sl4f"
}
test_package("sl4f-service-tests") {
deps = [
":lib_test",
]
resources = [
{
path = rebase_path("testdata/cast_factory_store.config")
dest = "cast_factory_store.config"
},
{
path = rebase_path("testdata/misc_factory_store.config")
dest = "misc_factory_store.config"
},
{
path = rebase_path("testdata/playready_factory_store.config")
dest = "playready_factory_store.config"
},
{
path = rebase_path("testdata/widevine_factory_store.config")
dest = "widevine_factory_store.config"
},
]
tests = [
{
name = "sl4f_lib_lib_test"
environments = basic_envs
},
]
}
config_data("fake-factory-store-providers-config") {
for_pkg = "fake_factory_store_providers"
sources = [
"testdata/cast_factory_store.config",
"testdata/misc_factory_store.config",
"testdata/playready_factory_store.config",
"testdata/widevine_factory_store.config",
]
}
unittest_package("sl4f-tests") {
deps = [
":bin_test",
]
tests = [
{
name = "sl4f_bin_test"
dest = "sl4f_bin_test"
environments = basic_envs
},
]
}
group("service-tests") {
testonly = true
deps = [
":fake-factory-store-providers-config",
":sl4f-service-tests",
"//src/factory/fake_factory_store_providers",
]
}
group("tests") {
testonly = true
deps = [
":service-tests",
":sl4f-tests",
"tests",
]
}
config_data("sl4f_sysmgr_config") {
for_pkg = "sysmgr"
outputs = [
"sl4f.config",
]
sources = [
"config/sl4f_sysmgr.config",
]
}